From 88ed6e25cadab7a38e59ca4c87b8de5567b158a9 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 27 十月 2022 11:55:57 +0800
Subject: [PATCH] update 优化 切换 maven 仓库到 华为云
---
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java
index a5be267..a7c51fa 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SaTokenConfig.java
@@ -1,7 +1,6 @@
package com.ruoyi.framework.config;
-import cn.dev33.satoken.interceptor.SaAnnotationInterceptor;
-import cn.dev33.satoken.interceptor.SaRouteInterceptor;
+import cn.dev33.satoken.interceptor.SaInterceptor;
import cn.dev33.satoken.jwt.StpLogicJwtForSimple;
import cn.dev33.satoken.router.SaRouter;
import cn.dev33.satoken.stp.StpLogic;
@@ -34,14 +33,14 @@
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 娉ㄥ唽璺敱鎷︽埅鍣紝鑷畾涔夐獙璇佽鍒�
- registry.addInterceptor(new SaRouteInterceptor((request, response, handler) -> {
+ registry.addInterceptor(new SaInterceptor(handler -> {
+ // 鑷畾涔夋敞瑙� @Anonymous 鍖垮悕璁块棶閰嶇疆锛屽悗缁増鏈皢鍒犻櫎
ExcludeUrlProperties excludeUrlProperties = SpringUtils.getBean(ExcludeUrlProperties.class);
// 鐧诲綍楠岃瘉 -- 鎺掗櫎澶氫釜璺緞
SaRouter
// 鑾峰彇鎵�鏈夌殑
.match("/**")
- // 鎺掗櫎涓嬩笉闇�瑕佹嫤鎴殑
- .notMatch(securityProperties.getExcludes())
+ // 鎺掗櫎涓嬩笉闇�瑕佹嫤鎴殑锛堟瘡娆″尮閰嶏級
.notMatch(excludeUrlProperties.getExcludes())
// 瀵规湭鎺掗櫎鐨勮矾寰勮繘琛屾鏌�
.check(() -> {
@@ -55,8 +54,9 @@
// }
});
- })).addPathPatterns("/**");
- registry.addInterceptor(new SaAnnotationInterceptor()).addPathPatterns("/**");
+ })).addPathPatterns("/**")
+ // 鎺掗櫎涓嶉渶瑕佹嫤鎴殑璺緞
+ .excludePathPatterns(securityProperties.getExcludes());
}
@Bean
--
Gitblit v1.9.3