From 8bcdb8600c6465b7a1d63dfe52ea05df4fb88409 Mon Sep 17 00:00:00 2001 From: lzp <15321168632@163.com> Date: Thu, 27 Jan 2022 10:33:52 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=AE=A4=E8=AF=81=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/core/handler/AccessDeniedHandlerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java index fa0c4b373..33f3f14f4 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/core/handler/AccessDeniedHandlerImpl.java @@ -16,6 +16,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.FORBIDDEN; import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.UNAUTHORIZED; /** @@ -36,7 +37,7 @@ public class AccessDeniedHandlerImpl implements AccessDeniedHandler { log.warn("[commence][访问 URL({}) 时,用户({}) 权限不够]", request.getRequestURI(), SecurityFrameworkUtils.getLoginUserId(), e); // 返回 403 - ServletUtils.writeJSON(response, CommonResult.error(UNAUTHORIZED)); + ServletUtils.writeJSON(response, CommonResult.error(FORBIDDEN)); } }