临时打开登陆

This commit is contained in:
Github_lizhw 2025-03-31 23:24:20 +08:00
parent 5333d94f44
commit a1aaa31611

View File

@ -46,6 +46,9 @@ public class AuthFilter {
ServerHttpRequest request = SaReactorSyncHolder.getContext().getRequest();
// 检查是否登录 是否有token
try {
// if (!StpUtil.isLogin()) {
// StpUtil.login(1);
// }
StpUtil.checkLogin();
} catch (NotLoginException e) {
if (request.getURI().getPath().contains("sse")) {
@ -73,8 +76,8 @@ public class AuthFilter {
// }
});
}).setError(e -> {
log.error("认证错误", e);
if (e instanceof NotLoginException) {
log.error("认证错误", e);
if (e instanceof NotLoginException) {
return SaResult.error(e.getMessage()).setCode(HttpStatus.UNAUTHORIZED);
}
return SaResult.error("认证失败,无法访问系统资源").setCode(HttpStatus.UNAUTHORIZED);