浏览代码

no message

FengChaoYu 2 月之前
父节点
当前提交
669116a04c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      mall-miniapp-service/src/main/java/com/gree/mall/miniapp/config/aop/ApiAspect.java

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

@@ -71,7 +71,7 @@ public class ApiAspect {
         String token = CommonUtils.getToken(request);
         String token = CommonUtils.getToken(request);
         log.info("用户token:{} 访问 {}", token, request.getRequestURI());
         log.info("用户token:{} 访问 {}", token, request.getRequestURI());
         String jwtUserId = CommonUtils.getUserId(request);
         String jwtUserId = CommonUtils.getUserId(request);
-        if (StringUtils.isNotBlank(jwtUserId) && token.equals(jwtUserId)) {
+        if (StringUtils.isNotBlank(jwtUserId) && StringUtils.isNotBlank(token) && token.equals(jwtUserId)) {
             throw new RemoteServiceException(ResponseHelper.ResponseCode_TOKEN_ID_ERROR, "请求不合法, token");
             throw new RemoteServiceException(ResponseHelper.ResponseCode_TOKEN_ID_ERROR, "请求不合法, token");
         }
         }