fix 修复 gateway 白名单热更不生效问题
parent
e46d286270
commit
ffdeb0ba4f
|
|
@ -11,24 +11,27 @@ import org.springframework.context.annotation.Configuration;
|
|||
|
||||
/**
|
||||
* [Sa-Token 权限认证] 拦截器
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Configuration
|
||||
public class AuthFilter {
|
||||
|
||||
// 注册 Sa-Token全局过滤器
|
||||
/**
|
||||
* 注册 Sa-Token 全局过滤器
|
||||
*/
|
||||
@Bean
|
||||
public SaReactorFilter getSaReactorFilter(IgnoreWhiteProperties ignoreWhite) {
|
||||
return new SaReactorFilter()
|
||||
// 拦截地址
|
||||
.addInclude("/**")
|
||||
// 开放地址
|
||||
.setExcludeList(ignoreWhite.getWhites())
|
||||
.addExclude("/favicon.ico", "/actuator/**")
|
||||
// 鉴权方法:每次访问进入
|
||||
.setAuth(obj -> {
|
||||
// 登录校验 -- 拦截所有路由
|
||||
SaRouter.match("/**", r -> {
|
||||
SaRouter.match("/**")
|
||||
.notMatch(ignoreWhite.getWhites())
|
||||
.check(r -> {
|
||||
// 检查是否登录 是否有token
|
||||
StpUtil.checkLogin();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue