update satoken 1.27.0 => 1.28.0 使用 jwt 插件代理 token 生成逻辑

This commit is contained in:
疯狂的狮子li 2021-11-10 13:31:54 +08:00
parent 19b7f0747a
commit 7079a4e7e4
4 changed files with 32 additions and 2 deletions

View File

@ -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>

View File

@ -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

View File

@ -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>

View File

@ -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();
}
}