mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 01:48:47 +08:00
临时打开登陆
This commit is contained in:
parent
5333d94f44
commit
a1aaa31611
@ -46,6 +46,9 @@ public class AuthFilter {
|
|||||||
ServerHttpRequest request = SaReactorSyncHolder.getContext().getRequest();
|
ServerHttpRequest request = SaReactorSyncHolder.getContext().getRequest();
|
||||||
// 检查是否登录 是否有token
|
// 检查是否登录 是否有token
|
||||||
try {
|
try {
|
||||||
|
// if (!StpUtil.isLogin()) {
|
||||||
|
// StpUtil.login(1);
|
||||||
|
// }
|
||||||
StpUtil.checkLogin();
|
StpUtil.checkLogin();
|
||||||
} catch (NotLoginException e) {
|
} catch (NotLoginException e) {
|
||||||
if (request.getURI().getPath().contains("sse")) {
|
if (request.getURI().getPath().contains("sse")) {
|
||||||
@ -73,8 +76,8 @@ public class AuthFilter {
|
|||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
}).setError(e -> {
|
}).setError(e -> {
|
||||||
log.error("认证错误", e);
|
log.error("认证错误", e);
|
||||||
if (e instanceof NotLoginException) {
|
if (e instanceof NotLoginException) {
|
||||||
return SaResult.error(e.getMessage()).setCode(HttpStatus.UNAUTHORIZED);
|
return SaResult.error(e.getMessage()).setCode(HttpStatus.UNAUTHORIZED);
|
||||||
}
|
}
|
||||||
return SaResult.error("认证失败,无法访问系统资源").setCode(HttpStatus.UNAUTHORIZED);
|
return SaResult.error("认证失败,无法访问系统资源").setCode(HttpStatus.UNAUTHORIZED);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user