style: 使用常量优化部分魔法值,核心模块部分配置前缀调整

This commit is contained in:
2023-12-29 17:46:28 +08:00
parent 7b12454ce6
commit 52dce2acdf
6 changed files with 8 additions and 7 deletions

View File

@@ -35,6 +35,7 @@ import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import top.charles7c.continew.starter.core.constant.StringConstants;
import top.charles7c.continew.starter.core.handler.GeneralPropertySourceFactory;
/**
@@ -56,7 +57,7 @@ public class SaTokenAutoConfiguration implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验
registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin())).addPathPatterns("/**")
registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin())).addPathPatterns(StringConstants.PATH_PATTERN)
.excludePathPatterns(properties.getSecurity().getExcludes());
}