v1.21.0 更新

This commit is contained in:
click33 2021-07-02 17:33:31 +08:00
parent b836e1f75a
commit 7d0037066a
46 changed files with 79 additions and 63 deletions

View File

@ -1,7 +1,7 @@
<p align="center">
<img alt="logo" src="https://gitee.com/dromara/sa-token/raw/master/sa-token-doc/doc/logo.png" width="150" height="150">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Sa-Token v1.20.0</h1>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Sa-Token v1.21.0</h1>
<h4 align="center">这可能是史上功能最全的 Java 权限认证框架!</h4>
<p align="center">
<a href="https://gitee.com/dromara/sa-token/stargazers"><img src="https://gitee.com/dromara/sa-token/badge/star.svg"></a>

View File

@ -8,7 +8,7 @@
<groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId>
<packaging>pom</packaging>
<version>1.20.0</version>
<version>1.21.0</version>
<!-- 项目介绍 -->
<name>sa-token</name>
@ -36,7 +36,7 @@
<!-- 一些属性 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
<jdk.version>1.8</jdk.version>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -19,6 +19,7 @@ public class BackResultException extends SaTokenException {
/**
* 构造
* @param result 要输出的结果
*/
public BackResultException(Object result) {
super(String.valueOf(result));

View File

@ -87,7 +87,9 @@ public interface SaSsoInterface {
/**
* 根据 Ticket码 获取账号id并转换为指定类型
* @param <T> 要转换的类型
* @param ticket Ticket码
* @param cs 要转换的类型
* @return 账号id
*/
public default <T> T getLoginId(String ticket, Class<T> cs) {
@ -136,7 +138,7 @@ public interface SaSsoInterface {
}
/**
* 根据 Client端登录地址 & back地址 构建[SSO-Server端-认证地址]
* 构建URLServer端 单点登录地址
* @param clientLoginUrl Client端登录地址
* @param back 回调路径
* @return [SSO-Server端-认证地址 ]

View File

@ -52,7 +52,9 @@ public class SaSsoUtil {
/**
* 根据 Ticket码 获取账号id并转换为指定类型
* @param <T> 要转换的类型
* @param ticket Ticket码
* @param cs 要转换的类型
* @return 账号id
*/
public static <T> T getLoginId(String ticket, Class<T> cs) {
@ -77,7 +79,7 @@ public class SaSsoUtil {
}
/**
* 根据 Client端登录地址 & back地址 构建[SSO-Server端-认证地址]
* 构建URLServer端 单点登录地址
* @param clientLoginUrl Client端登录地址
* @param back 回调路径
* @return [SSO-Server端-认证地址 ]

View File

@ -340,8 +340,8 @@ public class StpLogic {
}
/**
* 会话注销根据账号id & 设备标识 踢人下线
* <p> 当对方再次访问系统时会抛出NotLoginException异常场景值=-2
* 会话注销根据账号id and 设备标识 踢人下线
* <p> 当对方再次访问系统时会抛出NotLoginException异常场景值=-2 </p>
* @param loginId 账号id
* @param device 设备标识 (填null代表所有注销设备)
*/
@ -1235,7 +1235,7 @@ public class StpLogic {
/**
* 在当前会话 开启二级认证
* @param timeout 维持时间 (单位: )
* @param safeTime 维持时间 (单位: )
*/
public void openSafe(long safeTime) {
long eff = System.currentTimeMillis() + safeTime * 1000;
@ -1265,7 +1265,7 @@ public class StpLogic {
/**
* 获取当前会话的二级认证剩余有效时间 (单位: , 返回-2代表尚未通过二级认证)
* @return
* @return 剩余有效时间
*/
public long getSafeTime() {
long eff = getTokenSession().get(SaTokenConsts.SAFE_AUTH_SAVE_KEY, 0L);

View File

@ -120,7 +120,7 @@ public class StpUtil {
/**
* 会话注销根据账号id 踢人下线
* <p> 当对方再次访问系统时会抛出NotLoginException异常场景值=-2
* <p> 当对方再次访问系统时会抛出NotLoginException异常场景值=-2 </p>
* @param loginId 账号id
*/
public static void logoutByLoginId(Object loginId) {
@ -128,7 +128,7 @@ public class StpUtil {
}
/**
* 会话注销根据账号id & 设备标识 踢人下线
* 会话注销根据账号id and 设备标识 踢人下线
* <p> 当对方再次访问系统时会抛出NotLoginException异常场景值=-2
* @param loginId 账号id
* @param device 设备标识
@ -596,7 +596,7 @@ public class StpUtil {
/**
* 在当前会话 开启二级认证
* @param timeout 维持时间 (单位: )
* @param safeTime 维持时间 (单位: )
*/
public static void openSafe(long safeTime) {
stpLogic.openSafe(safeTime);
@ -619,7 +619,7 @@ public class StpUtil {
/**
* 获取当前会话的二级认证剩余有效时间 (单位: , 返回-2代表尚未通过二级认证)
* @return
* @return 剩余有效时间
*/
public static long getSafeTime() {
return stpLogic.getSafeTime();

View File

@ -13,7 +13,7 @@ public class SaTokenConsts {
/**
* Sa-Token 当前版本号
*/
public static final String VERSION_NO = "v1.20.0";
public static final String VERSION_NO = "v1.21.0";
/**
* Sa-Token 开源地址

View File

@ -16,7 +16,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -16,7 +16,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -15,7 +15,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -9,7 +9,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -16,7 +16,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -16,7 +16,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -16,7 +16,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>
@ -51,7 +51,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-alone-redis</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
</dependencies>

View File

@ -16,7 +16,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -16,7 +16,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -16,7 +16,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -16,7 +16,7 @@
<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.20.0</sa-token-version>
<sa-token-version>1.21.0</sa-token-version>
</properties>
<dependencies>

View File

@ -1,7 +1,7 @@
<p align="center">
<img alt="logo" src="https://gitee.com/dromara/sa-token/raw/master/sa-token-doc/doc/logo.png" width="150" height="150">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Sa-Token v1.20.0</h1>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Sa-Token v1.21.0</h1>
<h4 align="center">这可能是史上功能最全的 Java 权限认证框架!</h4>
<p align="center">
<a href="https://gitee.com/dromara/sa-token/stargazers"><img src="https://gitee.com/dromara/sa-token/badge/star.svg"></a>

View File

@ -21,6 +21,7 @@
<nav>
<select onchange="location.href=this.value">
<option value="http://sa-token.dev33.cn/doc/index.html">最新版</option>
<option value="http://sa-token.dev33.cn/v/v1.20.0/doc/index.html">v1.20.0</option>
<option value="http://sa-token.dev33.cn/v/v1.19.0/doc/index.html">v1.19.0</option>
<option value="http://sa-token.dev33.cn/v/v1.18.0/doc/index.html">v1.18.0</option>
<option value="http://sa-token.dev33.cn/v/v1.17.0/doc/index.html">v1.17.0</option>
@ -50,7 +51,7 @@
</div>
<script>
var name = '<img style="width: 60px; height: 60px; vertical-align: middle;" src="logo.png" alt="logo" /> ';
name += '<b style="font-size: 28px; vertical-align: middle;">Sa-Token</b> <sub>v1.20.0</sub>'
name += '<b style="font-size: 28px; vertical-align: middle;">Sa-Token</b> <sub>v1.21.0</sub>'
window.$docsify = {
name: name, // 名字
repo: 'https://github.com/dromara/sa-token', // github地址

View File

@ -1,6 +1,16 @@
# 更新日志
### 2021-7-2 @v1.21.0
- 新增新增Token二级认证 **[重要]**
- 新增:新增`Sa-Token-Alone-Redis`独立Redis插件 **[重要]**
- 新增新增SSO三种模式彻底解决所有场景下的单点登录问题 **[重要]**
- 新增:新增多账号模式下,注解合并示例 **[重要]**
- 新增:新增`SaRouter.back()`函数,用于停止匹配返回结果
- 不兼容更新重构:
- 更改yml配置前缀原`[spring.sa-token.]` 改为 `[sa-token.]`,目前版本暂时向下兼容,请尽快更新
### 2021-6-17 @v1.20.0
- 新增新增Solon适配插件感谢大佬 `@刘西东` 提供的pr **[重要]**
- 新增:新增`SaRouter.stop()`函数,用于一次性跳出匹配链功能 **[重要]**

View File

@ -17,7 +17,7 @@ Sa-Token默认的Redis集成方式会把权限数据和业务缓存放在一起
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-alone-redis</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```

View File

@ -11,7 +11,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-aop</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```

View File

@ -49,7 +49,7 @@ Sa-Token-Quick-Login的定位是这样的场景你的项目需要一个登录
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-quick-login</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```

View File

@ -60,7 +60,7 @@ SaTempUtil.getTimeout(token);
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-temp-jwt</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```

View File

@ -46,14 +46,14 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
<!-- Sa-Token整合redis (使用jackson序列化方式) -->
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis-jackson</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
<!-- 提供Redis连接池 -->
@ -183,7 +183,7 @@ public class SaSsoServerApplication {
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-alone-redis</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```

View File

@ -14,7 +14,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```
@ -25,7 +25,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-reactor-spring-boot-starter</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```
@ -36,7 +36,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-servlet</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```
@ -47,7 +47,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-core</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```
<!---------------------------- tabs:end ------------------------------>
@ -57,19 +57,19 @@
<!-- tabs:start -->
<!-- tab:SpringMVC环境 ServletAPI -->
``` xml
implementation 'cn.dev33:sa-token-spring-boot-starter:1.20.0'
implementation 'cn.dev33:sa-token-spring-boot-starter:1.21.0'
```
<!-- tab:WebFlux环境 Reactor -->
``` xml
implementation 'cn.dev33:sa-token-reactor-spring-boot-starter:1.20.0'
implementation 'cn.dev33:sa-token-reactor-spring-boot-starter:1.21.0'
```
<!-- tab:Servlet容器环境 -->
``` xml
implementation 'cn.dev33:sa-token-servlet:1.20.0'
implementation 'cn.dev33:sa-token-servlet:1.21.0'
```
<!-- tab:其它 -->
``` xml
implementation 'cn.dev33:sa-token-core:1.20.0'
implementation 'cn.dev33:sa-token-core:1.21.0'
```
<!-- tabs:end -->

View File

@ -17,7 +17,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```

View File

@ -19,7 +19,7 @@ WebFlux基于Reactor响应式模型开发有着与标准ServletAPI完全不
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-reactor-spring-boot-starter</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```

View File

@ -14,7 +14,7 @@ Sa-token默认将会话数据保存在内存中此模式读写速度最快
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```
优点兼容性好缺点Session序列化后基本不可读对开发者来讲等同于乱码
@ -26,7 +26,7 @@ Sa-token默认将会话数据保存在内存中此模式读写速度最快
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis-jackson</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
```
优点Session序列化后可读性强可灵活手动修改缺点兼容性稍差

View File

@ -46,7 +46,7 @@
<div class="content-box">
<div class="fenge"></div>
<!-- <img class="title-logo" src="./doc/logo.png" onclick="alert('别点我, 快去点star')"> -->
<h1>Sa-Token<small>v1.20.0</small></h1>
<h1>Sa-Token<small>v1.21.0</small></h1>
<div class="sub-title"> 这可能是史上功能最全的java权限认证框架</div>
<div class="btn-box">
<a href="https://github.com/dromara/sa-token" target="_blank">GitHub</a>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>pom</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-plugin</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-plugin</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-plugin</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-plugin</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-plugin</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-plugin</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-plugin</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>pom</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-starter</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-starter</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-starter</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>
@ -25,7 +25,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-core</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</dependency>
</dependencies>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-starter</artifactId>
<version>1.20.0</version>
<version>1.21.0</version>
</parent>
<packaging>jar</packaging>