Commit dff0ff9b authored by zhouxudong's avatar zhouxudong

token过期处理

parent 74a1545a
......@@ -24,13 +24,7 @@ public class CurrentUserInterceptor implements AsyncHandlerInterceptor {
throw new AuthException("未授权,请重新登录");
}
String token = authToken.substring("Bearer".length() + 1).trim();
JwtInfo jwtUser;
try{
jwtUser = JwtTokenUtil.getJwtUser(token);
}catch (Exception e){
throw new AuthException("未授权,请重新登录");
}
JwtInfo jwtUser = JwtTokenUtil.getJwtUser(token);
// 根据token信息,生成当前登录用户信息的设置,存放容器threadlocal
BaseContextHandler.setCurrentUserInfo(jwtUser);
......
......@@ -101,9 +101,7 @@ public class JwtTokenUtil {
Long nowTime = System.currentTimeMillis();
log.debug("nowTime : " + nowTime);
if (nowTime > expireTime) {
resultMap.clear();
flag = false;
resultMap.put(TokenConstants.RESULT, TokenConstants.TOKEN_RESULT.TOKEN_EXPIRED);
throw new AuthException("token过期");
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment