Sa-Token 监听器实现

This commit is contained in:
shengzhang
2021-04-17 02:54:43 +08:00
parent 078119e12c
commit 34a3f68ad8
11 changed files with 271 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ import org.springframework.util.PathMatcher;
import cn.dev33.satoken.SaTokenManager;
import cn.dev33.satoken.action.SaTokenAction;
import cn.dev33.satoken.aop.SaTokenListener;
import cn.dev33.satoken.config.SaTokenConfig;
import cn.dev33.satoken.context.SaTokenContext;
import cn.dev33.satoken.context.SaTokenContextForThreadLocal;
@@ -102,6 +103,15 @@ public class SaTokenSpringAutowired {
SaTokenManager.setSaTokenContext(saTokenContext);
}
/**
* 注入监听器Bean
*
* @param saTokenListener saTokenListener对象
*/
@Autowired(required = false)
public void setSaTokenListener(SaTokenListener saTokenListener) {
SaTokenManager.setSaTokenListener(saTokenListener);
}
/**
* 利用自动匹配特性获取SpringMVC框架内部使用的路由匹配器
*