FengChaoYu 1 month ago
parent
commit
a303c627bb

+ 10 - 10
src/main/java/com/gree/mall/manager/constant/Constant.java

@@ -31,16 +31,16 @@ public class Constant {
     }
 
     public class RedisPrefix {
-        public final static String WORK_MINI_ACCESS_TOKEN = "mall:work:mini:access:token";
-        public final static String TOKEN_WX = "mall:token:wx";
-        public final static String TOKEN_TAX = "mall:token:tax";
-        public final static String TOKEN_GONGDAN = "mall:token:gongdan";
-        public final static String LOCK_ORDER = "mall:lock:order";
-        public final static String LOCK_ORDER_STOCK = "mall:lock:stock";
-        public final static String LOCK_WX_SYNC = "mall:lock:wx:sync";
-        public final static String LOCK_SOP_SYNC = "mall:lock:sop";
-        public final static String CHAT_MESSAGE_SEQ_KEY = "CHAT_MESSAGE_SEQ";
-        public final static String LOCK_EXCHANGE_CODE = "mall:lock:exchangecode";
+        public final static String WORK_MINI_ACCESS_TOKEN = "new:mall:work:mini:access:token";
+        public final static String TOKEN_WX = "new:mall:token:wx";
+        public final static String TOKEN_TAX = "new:mall:token:tax";
+        public final static String TOKEN_GONGDAN = "new:mall:token:gongdan";
+        public final static String LOCK_ORDER = "new:mall:lock:order";
+        public final static String LOCK_ORDER_STOCK = "new:mall:lock:stock";
+        public final static String LOCK_WX_SYNC = "new:mall:lock:wx:sync";
+        public final static String LOCK_SOP_SYNC = "new:mall:lock:sop";
+        public final static String CHAT_MESSAGE_SEQ_KEY = "new:CHAT_MESSAGE_SEQ";
+        public final static String LOCK_EXCHANGE_CODE = "new:mall:lock:exchangecode";
 
     }
     public class ChatMessage {

+ 3 - 3
src/main/java/com/gree/mall/manager/enums/RedisPrefixEnum.java

@@ -4,7 +4,7 @@ import lombok.Getter;
 
 @Getter
 public enum RedisPrefixEnum {
-    TOKEN_MGR,
-    TOKEN_WX,
-    TOKEN_VERIFICATION
+    TOKEN_NEW_MGR,
+    TOKEN_NEW_WX,
+    TOKEN_NEW_VERIFICATION
 }

+ 5 - 8
src/main/java/com/gree/mall/manager/logic/admin/AdminUserLogic.java

@@ -1,6 +1,5 @@
 package com.gree.mall.manager.logic.admin;
 
-import cn.hutool.json.JSONObject;
 import com.aliyuncs.utils.StringUtils;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -13,11 +12,9 @@ import com.gree.mall.manager.bean.admin.AdminModuleTree;
 import com.gree.mall.manager.bean.admin.AdminUserBean;
 import com.gree.mall.manager.bean.admin.AdminUserCom;
 import com.gree.mall.manager.bean.admin.ExternalMapBean;
-import com.gree.mall.manager.bean.admin.reqDto.AdminCompanyWechatReqBean;
 import com.gree.mall.manager.bean.admin.reqDto.AdminUserAddReqBean;
 import com.gree.mall.manager.commonmapper.AdminMapper;
 import com.gree.mall.manager.enums.RedisPrefixEnum;
-import com.gree.mall.manager.enums.RoleTypeEnum;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.plus.entity.*;
@@ -85,7 +82,7 @@ public class AdminUserLogic {
         String baseStr = Base64.getEncoder().encodeToString(b);
         //生成一个token
         String code = UUID.randomUUID().toString();
-        redisUtil.set(RedisPrefixEnum.TOKEN_VERIFICATION + code, text, 2 * 60);
+        redisUtil.set(RedisPrefixEnum.TOKEN_NEW_VERIFICATION + code, text, 2 * 60);
         SVerification verification = new SVerification();
         verification.setCode(code);
         verification.setPic(baseStr);
@@ -96,7 +93,7 @@ public class AdminUserLogic {
      * 登录
      */
     public AdminUserBean login(String userName, String password, String code, String codeValue) throws RemoteServiceException {
-        String value = (String) redisUtil.get(RedisPrefixEnum.TOKEN_VERIFICATION + code);
+        String value = (String) redisUtil.get(RedisPrefixEnum.TOKEN_NEW_VERIFICATION + code);
         if (!value.equals(codeValue)) {
             throw new RemoteServiceException("验证码错误");
         }
@@ -119,7 +116,7 @@ public class AdminUserLogic {
         List<AdminUserCompanyRela> list = adminUserCompanyRelaService.lambdaQuery().eq(AdminUserCompanyRela::getAdminUserId, adminUser.getAdminUserId()).list();
         adminUserBean.setAdminUserCompanyRelaList(list);
         //存放到redis
-        redisUtil.set(RedisPrefixEnum.TOKEN_MGR.toString() + adminUserBean.getToken(), adminUser, 20 * 60 * 60 * 1000);
+        redisUtil.set(RedisPrefixEnum.TOKEN_NEW_MGR.toString() + adminUserBean.getToken(), adminUser, 20 * 60 * 60 * 1000);
         return adminUserBean;
     }
 
@@ -440,7 +437,7 @@ public class AdminUserLogic {
      */
     public void logout(HttpServletRequest request) {
         String token = CommonUtils.getToken(request);
-        redisUtil.del(RedisPrefixEnum.TOKEN_MGR + token);
+        redisUtil.del(RedisPrefixEnum.TOKEN_NEW_MGR + token);
     }
 
 
@@ -601,7 +598,7 @@ public class AdminUserLogic {
             adminUserBean.setToken(JwtUtils.createJWT(adminUser.getAdminUserId(), adminUser.getNickName(), adminUser.getUserName(), 20 * 60 * 60 * 1000));
 
             //存放到redis
-            redisUtil.set(RedisPrefixEnum.TOKEN_MGR.toString() + adminUserBean.getToken(), adminUser, 20 * 60 * 60 * 1000);
+            redisUtil.set(RedisPrefixEnum.TOKEN_NEW_MGR.toString() + adminUserBean.getToken(), adminUser, 20 * 60 * 60 * 1000);
 
             // 返回结果
             ExternalMapBean bean = new ExternalMapBean();

+ 0 - 1
src/main/resources/bootstrap-dev.properties

@@ -13,7 +13,6 @@ wechat.payment.refundNotifyUrl=
 
 #常规设置
 server.port =11003
-server.servlet.context-path=
 spring.servlet.multipart.max-file-size=40MB
 spring.servlet.multipart.max-request-size=40MB
 #是否直接web端打印错误信息

+ 0 - 1
src/main/resources/bootstrap-prd.properties

@@ -11,7 +11,6 @@ wechat.payment.refundNotifyUrl=
 
 #常规设置
 server.port =11003
-server.servlet.context-path=
 spring.servlet.multipart.max-file-size=40MB
 spring.servlet.multipart.max-request-size=40MB
 #是否直接web端打印错误信息

+ 0 - 1
src/main/resources/bootstrap-test.properties

@@ -13,7 +13,6 @@ wechat.payment.refundNotifyUrl=
 
 #常规设置
 server.port =11003
-server.servlet.context-path=
 spring.servlet.multipart.max-file-size=40MB
 spring.servlet.multipart.max-request-size=40MB
 #是否直接web端打印错误信息

+ 2 - 0
src/main/resources/bootstrap.properties

@@ -6,3 +6,5 @@ spring.cloud.nacos.config.enabled=false
 spring.cloud.nacos.discovery.enabled=false
 
 goods.share.limit.percent=0.4
+
+server.servlet.context-path=/mallMini