优化处理
This commit is contained in:
@@ -20,17 +20,18 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
// 注意:已配置 server.servlet.context-path=/api,拦截器路径匹配不需要再带 /api 前缀
|
||||
registry.addInterceptor(jwtAuthInterceptor)
|
||||
.addPathPatterns("/api/**") // 拦截所有API请求
|
||||
.addPathPatterns("/**") // 拦截应用内的所有请求(已去掉 /api 前缀)
|
||||
.excludePathPatterns(
|
||||
"/api/auth/login", // 登录接口
|
||||
"/api/auth/register", // 注册接口
|
||||
"/api/auth/captcha", // 图形验证码接口
|
||||
"/api/auth/sms-code", // 短信验证码接口(免登录)
|
||||
"/api/auth/refresh-token", // 刷新token接口
|
||||
"/api/auth/resetPassword", // 重置密码接口(免登录)
|
||||
"/api/health", // 健康检查接口
|
||||
"/api/ws/**", // WebSocket接口
|
||||
"/auth/login", // 登录接口
|
||||
"/auth/register", // 注册接口
|
||||
"/auth/captcha", // 图形验证码接口
|
||||
"/auth/sms-code", // 短信验证码接口(免登录)
|
||||
"/auth/refresh-token", // 刷新token接口
|
||||
"/auth/resetPassword", // 重置密码接口(免登录)
|
||||
"/health", // 健康检查接口
|
||||
"/ws/**", // WebSocket接口
|
||||
"/swagger-ui/**", // Swagger UI
|
||||
"/v3/api-docs/**", // API文档
|
||||
"/actuator/**" // 监控端点
|
||||
|
||||
Reference in New Issue
Block a user