增强 SaRouter 链式匹配能力

This commit is contained in:
click33
2021-10-04 17:58:53 +08:00
parent 474a560691
commit cf6632df79
15 changed files with 847 additions and 147 deletions

View File

@@ -161,7 +161,7 @@ public class SaReactorFilter implements WebFilter {
SaReactorSyncHolder.setContext(exchange);
// 执行全局过滤器
SaRouter.match(includeList, excludeList, () -> {
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
beforeAuth.run(null);
auth.run(null);
});

View File

@@ -143,11 +143,11 @@ public class SaTokenPathFilter implements Filter {
public void doFilter(Context ctx, FilterChain chain) throws Throwable {
try {
// 执行全局过滤器
SaRouter.match(includeList, excludeList, () -> {
beforeAuth.run(null);
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
beforeAuth.run(null);
auth.run(null);
});
} catch (StopMatchException e) {
} catch (Throwable e) {

View File

@@ -38,7 +38,7 @@ public class SaResponseForSolon implements SaResponse {
@Override
public SaResponse setStatus(int sc) {
ctx.statusSet(sc);
ctx.status(sc);
return this;
}

View File

@@ -155,7 +155,7 @@ public class SaServletFilter implements Filter {
try {
// 执行全局过滤器
SaRouter.match(includeList, excludeList, () -> {
SaRouter.match(includeList).notMatch(excludeList).check(r -> {
beforeAuth.run(null);
auth.run(null);
});