From 3bcb509165813e4fb50989e3b7ed6fc6dfb082a6 Mon Sep 17 00:00:00 2001
From: guyue <1721849008@qq.com>
Date: 星期四, 17 七月 2025 19:20:19 +0800
Subject: [PATCH] 修改token拦截器

---
 src/main/java/com/linghu/config/WebConfig.java |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/linghu/config/WebConfig.java b/src/main/java/com/linghu/config/WebConfig.java
index a7f4558..557d5c0 100644
--- a/src/main/java/com/linghu/config/WebConfig.java
+++ b/src/main/java/com/linghu/config/WebConfig.java
@@ -23,11 +23,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