diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java index feb26f26..642acddc 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java @@ -130,14 +130,8 @@ public class TokenFilter implements Filter { error(response); return; } - if (!cacheHelper.exist(userKey)) { - error(response); - return; - } + String gaeaUserJsonStr = cacheHelper.stringGet(userKey); - // 延长有效期 - cacheHelper.stringSetExpire(tokenKey, token, 3600); - cacheHelper.stringSetExpire(userKey, gaeaUserJsonStr, 3600); // 判断用户是否有该url的权限 if (!BusinessConstant.USER_ADMIN.equals(loginName)) { @@ -148,6 +142,10 @@ public class TokenFilter implements Filter { } } + // 延长有效期 + cacheHelper.stringSetExpire(tokenKey, token, 3600); + cacheHelper.stringSetExpire(userKey, gaeaUserJsonStr, 3600); + //执行 filterChain.doFilter(request, response);