mirror of
https://gitee.com/dromara/sa-token.git
synced 2026-02-27 16:50:24 +08:00
!321 sa-token-solon-plugin 优化 SaTokenFilter 获取主处理的代码
Merge pull request !321 from 西东/dev
This commit is contained in:
@@ -151,8 +151,12 @@ public class SaTokenFilter implements SaFilter, Filter { //之所以改名,为
|
||||
@Override
|
||||
public void doFilter(Context ctx, FilterChain chain) throws Throwable {
|
||||
try {
|
||||
//查找当前主处理
|
||||
Handler mainHandler = Solon.app().router().matchMain(ctx);
|
||||
//查找当前主处理(在网关内用时,可直接获取缓存)
|
||||
Handler mainHandler = ctx.mainHandler();
|
||||
if (mainHandler == null) {
|
||||
mainHandler = Solon.app().router().matchMain(ctx);
|
||||
}
|
||||
|
||||
if (mainHandler instanceof Gateway) {
|
||||
//支持网关处理
|
||||
Gateway gateway = (Gateway) mainHandler;
|
||||
|
||||
Reference in New Issue
Block a user