Browse Source

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu 3 months ago
parent
commit
b8ce6c92f8

+ 11 - 4
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/config/aop/ApiAspect.java

@@ -78,14 +78,21 @@ public class ApiAspect {
 
         //String userId = CommonUtils.getUserId(request);
         String userId = (String)redisUtil.get(Constant.RedisPrefix.TOKEN_WX+token);
-        if (StringUtils.isBlank(userId)) {
-            throw new RemoteServiceException(ResponseHelper.ResponseCode_AUTH_ERROR, "请求不合法");
+        if (StringUtils.isBlank(userId) || StringUtils.isBlank(jwtUserId)) {
+            throw new RemoteServiceException(ResponseHelper.ResponseCode_TOKEN_ID_ERROR, "请求不合法");
         }
+
+
+        User userToken = userService.getById(jwtUserId);
+        if (userToken == null) {
+            throw new RemoteServiceException(ResponseHelper.ResponseCode_TOKEN_ID_ERROR, "请求不合法");
+        }
+
+
         User user = userService.getById(userId);
         if(user == null){
-                throw new RemoteServiceException(ResponseHelper.ResponseCode_AUTH_ERROR, "用户不存在,请联系相关人员");
+            throw new RemoteServiceException(ResponseHelper.ResponseCode_AUTH_ERROR, "用户不存在,请联系相关人员");
         }
-
     }
 
     private Method getSourceMethod(JoinPoint jp) {

+ 3 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/controller/user/UserController.java

@@ -293,8 +293,11 @@ public class UserController {
     public ResponseHelper<WxJsApiSignBean> apply(
             @ApiParam(required = true, value = "当前页面路径") @RequestParam(required = true) String url
     ){
+       // log.info("请求获取公众号jsapi"+url);
         CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
         WxJsApiSignBean pubJsapiSign = wechatLogic.getPubJsapiSign(currentCompanyWechat.getCompanyWechatId(), url);
+
+        log.info("=====11请求获取公众号jsapi"+url+"返回内容"+pubJsapiSign);
         return ResponseHelper.success(pubJsapiSign);
     }
 

+ 3 - 3
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/user/UserLogic.java

@@ -720,11 +720,11 @@ public class UserLogic {
 
     private UserWxBean appUser(User user) {
         UserWxBean userWxBean = new UserWxBean();
-        String token = JwtUtils.createJWT(user.getUserId(), user.getNickName(), 100 * 24 * 60 * 60);
+        String token = JwtUtils.createJWT(user.getUserId(), user.getNickName(), 100 * 24 * 60 * 60 * 1000);
         BeanUtils.copyProperties(user, userWxBean);
         userWxBean.setToken(token);
-        redisUtil.set(Constant.RedisPrefix.TOKEN_WX + token, userWxBean.getUserId(), 100 * 24 * 60 * 60);
-        redisUtil.set(Constant.RedisPrefix.TOKEN_APP_USER + token, user, 100 * 24 * 60 * 60);
+        redisUtil.set(Constant.RedisPrefix.TOKEN_WX + token, userWxBean.getUserId(), 100 * 24 * 60 * 60 * 1000);
+        redisUtil.set(Constant.RedisPrefix.TOKEN_APP_USER + token, user, 100 * 24 * 60 * 60 * 1000);
         return userWxBean;
     }
 

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/common/WechatLogic.java

@@ -690,7 +690,7 @@ public class WechatLogic {
         if (!StringUtils.equals(settlementOrder.getPayStatus(), PayStatusEnum.PAID.getKey())) {
             throw new RemoteServiceException("未支付订单不可结算");
         }
-        if (!StringUtils.equals(settlementOrder.getStatus(), "WAIT")) {
+        if (!StringUtils.equalsAny(settlementOrder.getStatus(), "WAIT","YC")) {
             log.error("非待结算状态不可结算,id:{}", settlementOrder.getOrderId());
             return;
         }