mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-18 17:48:03 +08:00
将全局过滤器的 BeforeAuth 认证设为不受 includeList 与 excludeList 的限制,所有请求都会进入
This commit is contained in:
@@ -123,11 +123,12 @@ public class SaTokenFilter implements SaFilter, Filter { //之所以改名,为
|
|||||||
Handler mainHandler = Solon.app().router().matchMain(ctx);
|
Handler mainHandler = Solon.app().router().matchMain(ctx);
|
||||||
Action action = (mainHandler instanceof Action ? (Action) mainHandler : null);
|
Action action = (mainHandler instanceof Action ? (Action) mainHandler : null);
|
||||||
|
|
||||||
//先路径过滤下(包括了静态文件)
|
|
||||||
//1.执行前置处理(主要是一些跨域之类的)
|
//1.执行前置处理(主要是一些跨域之类的)
|
||||||
if(beforeAuth != null) {
|
if(beforeAuth != null) {
|
||||||
beforeAuth.run(mainHandler);
|
beforeAuth.run(mainHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//先路径过滤下(包括了静态文件)
|
||||||
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
|
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
|
||||||
//2.执行注解处理
|
//2.执行注解处理
|
||||||
if(authAnno(action)) {
|
if(authAnno(action)) {
|
||||||
|
@@ -172,19 +172,19 @@ public class SaTokenInterceptor implements RouterInterceptor {
|
|||||||
try {
|
try {
|
||||||
Action action = (mainHandler instanceof Action ? (Action) mainHandler : null);
|
Action action = (mainHandler instanceof Action ? (Action) mainHandler : null);
|
||||||
|
|
||||||
//先路径过滤下(包括了静态文件)
|
//1.执行前置处理(主要是一些跨域之类的)
|
||||||
|
if(beforeAuth != null) {
|
||||||
|
beforeAuth.run(mainHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
//先路径过滤下(不包括静态文件)
|
||||||
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
|
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
|
||||||
//1.执行前置处理(主要是一些跨域之类的)
|
|
||||||
if(beforeAuth != null) {
|
|
||||||
beforeAuth.run(mainHandler);
|
|
||||||
}
|
|
||||||
//2.执行注解处理
|
//2.执行注解处理
|
||||||
if(authAnno(action)) {
|
if(authAnno(action)) {
|
||||||
//3.执行规则处理(如果没有被 @SaIgnore 忽略)
|
//3.执行规则处理(如果没有被 @SaIgnore 忽略)
|
||||||
auth.run(mainHandler);
|
auth.run(mainHandler);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (StopMatchException e) {
|
} catch (StopMatchException e) {
|
||||||
|
|
||||||
} catch (SaTokenException e) {
|
} catch (SaTokenException e) {
|
||||||
|
Reference in New Issue
Block a user