From d413baeb9891496af62b05bde87607d45bf4e301 Mon Sep 17 00:00:00 2001 From: dataprince Date: Thu, 28 Sep 2023 22:08:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9D=E8=B5=96sa-token=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=EF=BC=9A1.35.0.RC=20=3D>=201.36.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../security/config/SecurityConfig.java | 31 +++---------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index 7d1b288..3cabbe2 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 17 3.1.4 1.6.7 - 1.35.0.RC + 1.36.0 8.0.33 3.1.1 5.0.1 diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/SecurityConfig.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/SecurityConfig.java index 4ac5ad3..09b7b5f 100644 --- a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/SecurityConfig.java +++ b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/SecurityConfig.java @@ -40,33 +40,11 @@ public class SecurityConfig implements WebMvcConfigurer { public void addInterceptors(InterceptorRegistry registry) { // 注册路由拦截器,自定义验证规则 registry.addInterceptor(new SaInterceptor(handler -> { - //AllUrlHandler allUrlHandler = SpringUtils.getBean(AllUrlHandler.class); + AllUrlHandler allUrlHandler = SpringUtils.getBean(AllUrlHandler.class); // 登录验证 -- 排除多个路径 SaRouter // 获取所有的 - //.match(allUrlHandler.getUrls()) // 拦截的 path 列表 - .match("/**") - .notMatch( - Arrays.asList( - "/*.html", - "/**/*.html", - "/**/*.css", - "/**/*.js", - "/**/*.css", - "/**/*.js", - "/profile/**", - "/favicon.ico", - "/error", - "/*/api-docs", - "/*/api-docs/**", - "/swagger-ui/index.html", - "/actuator", - "/actuator/**", - "/login", - "/register", - "/captchaImage", - "/captcha/get", - "/captcha/check")) + .match(allUrlHandler.getUrls()) // 拦截的 path 列表 .check(() -> { // 检查是否登录 是否有token StpUtil.checkLogin(); @@ -74,9 +52,8 @@ public class SecurityConfig implements WebMvcConfigurer { //TODO :以后完善多平台登录校验clientID功能 }); - })).addPathPatterns("/**"); + })).addPathPatterns("/**") // 排除不需要拦截的路径 - //.excludePathPatterns(securityProperties.getExcludes()); - + .excludePathPatterns(securityProperties.getExcludes()); } }