From e364d300bbbcbc6508185a0094abc4f116d60d78 Mon Sep 17 00:00:00 2001 From: guyue <1721849008@qq.com> Date: 星期三, 30 七月 2025 18:02:50 +0800 Subject: [PATCH] 去掉崩溃前修改为pending --- src/main/java/com/linghu/config/WebConfig.java | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/linghu/config/WebConfig.java b/src/main/java/com/linghu/config/WebConfig.java index a7f4558..cc73e2c 100644 --- a/src/main/java/com/linghu/config/WebConfig.java +++ b/src/main/java/com/linghu/config/WebConfig.java @@ -7,9 +7,11 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import javax.annotation.Resource; + @Configuration public class WebConfig implements WebMvcConfigurer { // 实现WebMvcConfigurer - @Autowired + @Resource private final OpenCryptUtil openCryptUtil; private final TokenInterceptor tokenInterceptor; @@ -23,11 +25,15 @@ @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(tokenInterceptor) - .addPathPatterns("/**"); // 拦截/api/开头的请求(按需调整) -// .excludePathPatterns( // 排除不需要拦截的路径(如登录、注册接口) -// "/api/login", -// "/api/register", -// "/error" // 排除错误页 -// ); + .addPathPatterns("/**")// 拦截/api/开头的请求(按需调整) + .excludePathPatterns( // 排除不需要拦截的路径(如登录、注册接口) + "/index/**", + "/auth/**", + "/swagger-ui.html", + "/swagger-resources/**", + "/v2/api-docs", + "/webjars/**" + + ); } } \ No newline at end of file -- Gitblit v1.7.1