|
|
@@ -56,10 +56,10 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
|
|
|
throw new FSException(jwtUtils.getHeader() + "失效,请重新登录", HttpStatus.UNAUTHORIZED.value());
|
|
|
}
|
|
|
//查询用户的TOKEN是否和REDIS中的一样
|
|
|
-// String redisToken=redisCache.getCacheObject("token:"+ Long.parseLong(claims.getSubject()));
|
|
|
-// if(redisToken==null||!redisToken.equals(token)){
|
|
|
-// throw new FSException(jwtUtils.getHeader() + "失效,请重新登录", HttpStatus.UNAUTHORIZED.value());
|
|
|
-// }
|
|
|
+ String redisToken=redisCache.getCacheObject("token:"+ Long.parseLong(claims.getSubject()));
|
|
|
+ if(redisToken==null||!redisToken.equals(token)){
|
|
|
+ throw new FSException(jwtUtils.getHeader() + "失效,请重新登录", HttpStatus.UNAUTHORIZED.value());
|
|
|
+ }
|
|
|
//设置userId到request里,后续根据userId,获取用户信息
|
|
|
request.setAttribute(USER_KEY, Long.parseLong(claims.getSubject()));
|
|
|
|