update 过滤离线用户

This commit is contained in:
疯狂的狮子Li 2021-12-09 16:32:32 +08:00
parent 2cd2e6dd19
commit da247c61b7
2 changed files with 0 additions and 3 deletions

View File

@ -48,7 +48,6 @@ public class SysUserOnlineController extends BaseController {
for (String key : keys) {
// 如果已经过期则踢下线
if (StpUtil.stpLogic.getTokenActivityTimeoutByToken(key) < 0) {
StpUtil.kickoutByTokenValue(key);
continue;
}
String onlineKey = key.replace(Constants.LOGIN_TOKEN_KEY, Constants.ONLINE_TOKEN_KEY);

View File

@ -59,8 +59,6 @@ public class GlobalExceptionHandler {
@ExceptionHandler(NotLoginException.class)
public AjaxResult<Void> handleAccessDeniedException(NotLoginException e, HttpServletRequest request) {
String requestURI = request.getRequestURI();
String token = e.getMessage().split("")[1];
StpUtil.kickoutByTokenValue(token);
log.error("请求地址'{}',认证失败'{}',无法访问系统资源", requestURI, e.getMessage());
return AjaxResult.error(HttpStatus.HTTP_UNAUTHORIZED, StringUtils.format("请求地址'{}',认证失败'{}',无法访问系统资源", requestURI));
}