From e2d370bd9d3d51c8bb4d702addb466fa5f3f13bf Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 26 十一月 2021 13:42:20 +0800 Subject: [PATCH] update 移除 satoken 自带集成 redis 改为使用 框架自身 Redission 实现 统一方案 性能优异 --- ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java index 6cf5e40..d0f00c6 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java @@ -9,7 +9,6 @@ import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.StringUtils; import lombok.extern.slf4j.Slf4j; -import org.springframework.security.access.AccessDeniedException; import org.springframework.validation.BindException; import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.MethodArgumentNotValidException; @@ -42,8 +41,7 @@ * 瑙掕壊鏍¢獙寮傚父 */ @ExceptionHandler(NotRoleException.class) - public AjaxResult handleAccessDeniedException(NotRoleException e, HttpServletRequest request) - { + public AjaxResult<Void> handleAccessDeniedException(NotRoleException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.error("璇锋眰鍦板潃'{}',瑙掕壊鏍¢獙澶辫触'{}'", requestURI, e.getMessage()); return AjaxResult.error(HttpStatus.HTTP_FORBIDDEN, "娌℃湁瑙掕壊锛岃鑱旂郴绠$悊鍛樻巿鏉�"); @@ -53,11 +51,10 @@ * 璁よ瘉澶辫触 */ @ExceptionHandler(NotLoginException.class) - public AjaxResult handleAccessDeniedException(NotLoginException e, HttpServletRequest request) - { + public AjaxResult<Void> handleAccessDeniedException(NotLoginException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); - log.error("璇锋眰璁块棶锛歿}锛岃璇佸け璐ワ紝鏃犳硶璁块棶绯荤粺璧勬簮", requestURI, e.getMessage()); - return AjaxResult.error(HttpStatus.HTTP_UNAUTHORIZED, StringUtils.format("璇锋眰璁块棶锛歿}锛岃璇佸け璐ワ紝鏃犳硶璁块棶绯荤粺璧勬簮", requestURI)); + log.error("璇锋眰鍦板潃'{}',璁よ瘉澶辫触'{}',鏃犳硶璁块棶绯荤粺璧勬簮", requestURI, e.getMessage()); + return AjaxResult.error(HttpStatus.HTTP_UNAUTHORIZED, StringUtils.format("璇锋眰鍦板潃'{}',璁よ瘉澶辫触'{}',鏃犳硶璁块棶绯荤粺璧勬簮", requestURI)); } /** -- Gitblit v1.9.3