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);
         log.info("用户token:{} 访问 {}", token, request.getRequestURI());
         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");
         }