update 删除异常用户token
This commit is contained in:
parent
e442bce607
commit
2cd2e6dd19
@ -3,6 +3,7 @@ package com.ruoyi.framework.web.exception;
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import cn.dev33.satoken.exception.NotPermissionException;
|
||||
import cn.dev33.satoken.exception.NotRoleException;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@ -59,7 +60,7 @@ public class GlobalExceptionHandler {
|
||||
public AjaxResult<Void> handleAccessDeniedException(NotLoginException e, HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
String token = e.getMessage().split(":")[1];
|
||||
RedisUtils.deleteObject(Constants.ONLINE_TOKEN_KEY + token);
|
||||
StpUtil.kickoutByTokenValue(token);
|
||||
log.error("请求地址'{}',认证失败'{}',无法访问系统资源", requestURI, e.getMessage());
|
||||
return AjaxResult.error(HttpStatus.HTTP_UNAUTHORIZED, StringUtils.format("请求地址'{}',认证失败'{}',无法访问系统资源", requestURI));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user