mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-06-28 13:34:18 +08:00
fix: 补全 SaFirewallCheckHook 全局自动注入
This commit is contained in:
parent
bfb34293d6
commit
a01eef8000
@ -38,6 +38,8 @@ import cn.dev33.satoken.stp.StpInterface;
|
||||
import cn.dev33.satoken.stp.StpLogic;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.dev33.satoken.strategy.SaAnnotationStrategy;
|
||||
import cn.dev33.satoken.strategy.SaFirewallStrategy;
|
||||
import cn.dev33.satoken.strategy.hooks.SaFirewallCheckHook;
|
||||
import cn.dev33.satoken.temp.SaTempInterface;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
@ -231,4 +233,16 @@ public class SaBeanInject {
|
||||
SaPathMatcherHolder.setPathMatcher(pathMatcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注入自定义防火墙校验 hook 集合
|
||||
*
|
||||
* @param hooks /
|
||||
*/
|
||||
@Autowired(required = false)
|
||||
public void setSaFirewallCheckHooks(List<SaFirewallCheckHook> hooks) {
|
||||
for (SaFirewallCheckHook hook : hooks) {
|
||||
SaFirewallStrategy.instance.registerHook(hook);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user