From 85b96101b386b6e7d17a28acf5c50e14697cd3bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E7=8B=BC=E8=93=9D=E5=A4=A9?= Date: Mon, 23 Sep 2024 15:09:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E8=A2=AB=E6=8B=A6=E6=88=AA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../harmony/config/SaTokenConfigure.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/guaiguailang/harmony/config/SaTokenConfigure.java b/src/main/java/com/guaiguailang/harmony/config/SaTokenConfigure.java index c12c275..c75ab5a 100644 --- a/src/main/java/com/guaiguailang/harmony/config/SaTokenConfigure.java +++ b/src/main/java/com/guaiguailang/harmony/config/SaTokenConfigure.java @@ -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/**" + ); } }