重构注解鉴权底层,可以方便的自定义注解了

This commit is contained in:
click33
2024-08-03 18:50:11 +08:00
parent a3746878de
commit 834e1d5b34
26 changed files with 210 additions and 560 deletions

View File

@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import cn.dev33.satoken.exception.DisableServiceException;
import cn.dev33.satoken.exception.NotBasicAuthException;
import cn.dev33.satoken.exception.NotHttpBasicAuthException;
import cn.dev33.satoken.exception.NotLoginException;
import cn.dev33.satoken.exception.NotPermissionException;
import cn.dev33.satoken.exception.NotRoleException;
@@ -66,8 +66,8 @@ public class HandlerException {
}
// Http Basic 校验失败code=903
@ExceptionHandler(NotBasicAuthException.class)
public SaResult handlerNotBasicAuthException(NotBasicAuthException e) {
@ExceptionHandler(NotHttpBasicAuthException.class)
public SaResult handlerNotBasicAuthException(NotHttpBasicAuthException e) {
return SaResult.error().setCode(903);
}