Commit 8bcdb8600c6465b7a1d63dfe52ea05df4fb88409

Authored by lzp
1 parent 678e2def

fix 认证错误码

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; @@ -16,6 +16,7 @@ import javax.servlet.http.HttpServletRequest;
16 import javax.servlet.http.HttpServletResponse; 16 import javax.servlet.http.HttpServletResponse;
17 import java.io.IOException; 17 import java.io.IOException;
18 18
  19 +import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.FORBIDDEN;
19 import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.UNAUTHORIZED; 20 import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.UNAUTHORIZED;
20 21
21 /** 22 /**
@@ -36,7 +37,7 @@ public class AccessDeniedHandlerImpl implements AccessDeniedHandler { @@ -36,7 +37,7 @@ public class AccessDeniedHandlerImpl implements AccessDeniedHandler {
36 log.warn("[commence][访问 URL({}) 时,用户({}) 权限不够]", request.getRequestURI(), 37 log.warn("[commence][访问 URL({}) 时,用户({}) 权限不够]", request.getRequestURI(),
37 SecurityFrameworkUtils.getLoginUserId(), e); 38 SecurityFrameworkUtils.getLoginUserId(), e);
38 // 返回 403 39 // 返回 403
39 - ServletUtils.writeJSON(response, CommonResult.error(UNAUTHORIZED)); 40 + ServletUtils.writeJSON(response, CommonResult.error(FORBIDDEN));
40 } 41 }
41 42
42 } 43 }