mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	update satoken 1.27.0 => 1.28.0 使用 jwt 插件代理 token 生成逻辑
This commit is contained in:
		
							
								
								
									
										8
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								pom.xml
									
									
									
									
									
								
							@@ -25,7 +25,7 @@
 | 
			
		||||
        <poi.version>4.1.2</poi.version>
 | 
			
		||||
        <easyexcel.version>2.2.11</easyexcel.version>
 | 
			
		||||
        <velocity.version>1.7</velocity.version>
 | 
			
		||||
        <satoken.version>1.27.0</satoken.version>
 | 
			
		||||
        <satoken.version>1.28.0</satoken.version>
 | 
			
		||||
        <mybatis-plus.version>3.4.3.4</mybatis-plus.version>
 | 
			
		||||
        <p6spy.version>3.9.1</p6spy.version>
 | 
			
		||||
        <hutool.version>5.7.15</hutool.version>
 | 
			
		||||
@@ -142,6 +142,12 @@
 | 
			
		||||
                <artifactId>sa-token-spring-aop</artifactId>
 | 
			
		||||
                <version>${satoken.version}</version>
 | 
			
		||||
            </dependency>
 | 
			
		||||
            <!-- Sa-Token 整合 jwt -->
 | 
			
		||||
            <dependency>
 | 
			
		||||
                <groupId>cn.dev33</groupId>
 | 
			
		||||
                <artifactId>sa-token-jwt</artifactId>
 | 
			
		||||
                <version>${satoken.version}</version>
 | 
			
		||||
            </dependency>
 | 
			
		||||
 | 
			
		||||
            <!-- jdk11 缺失依赖 jaxb-->
 | 
			
		||||
            <dependency>
 | 
			
		||||
 
 | 
			
		||||
@@ -114,7 +114,9 @@ sa-token:
 | 
			
		||||
  # token前缀
 | 
			
		||||
  token-prefix: "Bearer"
 | 
			
		||||
  # token风格
 | 
			
		||||
  token-style: random-128
 | 
			
		||||
  token-style: uuid
 | 
			
		||||
  # jwt秘钥
 | 
			
		||||
  jwt-secret-key: abcdefghijklmnopqrstuvwxyz
 | 
			
		||||
  # 是否输出操作日志
 | 
			
		||||
  is-log: true
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,11 @@
 | 
			
		||||
            <groupId>cn.dev33</groupId>
 | 
			
		||||
            <artifactId>sa-token-spring-aop</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <!-- Sa-Token 整合 jwt -->
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>cn.dev33</groupId>
 | 
			
		||||
            <artifactId>sa-token-jwt</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
 | 
			
		||||
        <!-- 自定义验证注解 -->
 | 
			
		||||
        <dependency>
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,17 @@
 | 
			
		||||
package com.ruoyi.framework.config;
 | 
			
		||||
 | 
			
		||||
import cn.dev33.satoken.jwt.StpLogicJwtForStyle;
 | 
			
		||||
import cn.dev33.satoken.stp.StpLogic;
 | 
			
		||||
import org.springframework.context.annotation.Bean;
 | 
			
		||||
import org.springframework.context.annotation.Configuration;
 | 
			
		||||
 | 
			
		||||
@Configuration
 | 
			
		||||
public class SaTokenConfig {
 | 
			
		||||
 | 
			
		||||
    @Bean
 | 
			
		||||
    public StpLogic getStpLogicJwt() {
 | 
			
		||||
        // Sa-Token 整合 jwt (Style模式)
 | 
			
		||||
        return new StpLogicJwtForStyle();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user