Browse Source

update report-core/src/main/java/com/anjiplus/template/gaea/business/filter/TokenFilter.java.

Raod 3 years ago
parent
commit
a576adff08

+ 5 - 7
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);