he2802 пре 4 година
родитељ
комит
b995b9114f

+ 1 - 1
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/SecurityUtils.java

@@ -21,7 +21,7 @@ import javax.annotation.PostConstruct;
 public class SecurityUtils
 {
 
-    @Value("${mybatis-plus.tenant.enabled-tenant:true}")
+   // @Value("${mybatis-plus.tenant.enabled-tenant:true}")
     public static boolean EnabledTenant;
 
     @Value("${mybatis-plus.tenant.enabled-tenant:true}")

+ 3 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/TokenService.java

@@ -85,6 +85,9 @@ public class TokenService
             String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
             String userKey = getTokenKey(uuid);
             LoginUser user = redisCache.getCacheObject(userKey);
+            if(Validator.isEmpty(user)){
+                throw new CustomException("令牌无效");
+            }
             return user;
         }