修复 接口文档被拦截的问题

This commit is contained in:
萌狼蓝天 2024-09-23 15:09:24 +08:00
parent 177b126998
commit 85b96101b3

View File

@ -19,9 +19,18 @@ public class SaTokenConfigure implements WebMvcConfigurer {
// 注册 Sa-Token 拦截器校验规则为 StpUtil.checkLogin() 登录校验
registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin()))
.addPathPatterns("/**")
.excludePathPatterns("/auth/**")
.excludePathPatterns("/user/doLogin")
.excludePathPatterns("/doc.html")
.excludePathPatterns("/swagger-ui.html");
.excludePathPatterns(
"/auth/**",
"/user/doLogin"
).excludePathPatterns(
"/doc.html",
"/doc.html/**",
"/swagger/**",
"/swagger-resources",
"/swagger-ui.html",
"/swagger-ui.html/**",
"/webjars/**",
"/v3/api-docs/**"
);
}
}