Commit f8a0d1778a65ce8a22c86552c6c40307c2509540

Authored by 芋道源码
Committed by Gitee
2 parents 678e2def 8bcdb860

!69 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 }