diff --git a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java index 28aacbcfb..4ed841dfe 100644 --- a/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java +++ b/ruoyi-common/ruoyi-common-web/src/main/java/org/dromara/common/web/handler/GlobalExceptionHandler.java @@ -1,5 +1,6 @@ package org.dromara.common.web.handler; +import cn.dev33.satoken.exception.NotLoginException; import cn.hutool.core.util.ObjectUtil; import cn.hutool.http.HttpStatus; import com.fasterxml.jackson.core.JsonParseException; @@ -10,7 +11,6 @@ import jakarta.validation.ConstraintViolationException; import lombok.extern.slf4j.Slf4j; import org.dromara.common.core.domain.R; import org.dromara.common.core.exception.ServiceException; -import org.dromara.common.core.exception.SseException; import org.dromara.common.core.exception.base.BaseException; import org.dromara.common.core.utils.StreamUtils; import org.dromara.common.json.utils.JsonUtils; @@ -62,8 +62,8 @@ public class GlobalExceptionHandler { * 认证失败 */ @ResponseStatus(org.springframework.http.HttpStatus.UNAUTHORIZED) - @ExceptionHandler(SseException.class) - public String handleNotLoginException(SseException e, HttpServletRequest request) { + @ExceptionHandler(NotLoginException.class) + public String handleNotLoginException(NotLoginException e, HttpServletRequest request) { String requestURI = request.getRequestURI(); log.debug("请求地址'{}',认证失败'{}',无法访问系统资源", requestURI, e.getMessage()); return JsonUtils.toJsonString(R.fail(HttpStatus.HTTP_UNAUTHORIZED, "认证失败,无法访问系统资源"));