v1.15.0.RELEASE 发布

This commit is contained in:
shengzhang
2021-03-24 01:44:19 +08:00
parent a8117a8021
commit 921e693e7e
25 changed files with 52 additions and 34 deletions

View File

@@ -1,11 +1,11 @@
<p align="center"> <p align="center">
<img alt="logo" src="https://gitee.com/sz6/sa-token/raw/master/sa-token-doc/doc/logo.png" width="150" height="150"> <img alt="logo" src="https://gitee.com/sz6/sa-token/raw/master/sa-token-doc/doc/logo.png" width="150" height="150">
</p> </p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.15.0</h1> <h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.15.0.RELEASE</h1>
<h4 align="center">这可能是史上功能最全的Java权限认证框架</h4> <h4 align="center">这可能是史上功能最全的Java权限认证框架</h4>
<h4 align="center"> <h4 align="center">
<a href="https://gitee.com/sz6/sa-token/stargazers"><img src="https://gitee.com/sz6/sa-token/badge/star.svg"></a> <a href="https://gitee.com/sz6/sa-token/stargazers"><img src="https://gitee.com/sz6/sa-token/badge/star.svg"></a>
<a href="https://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.15.0-2B9939"></a> <a href="https://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.15.0.RELEASE-2B9939"></a>
<a href="https://github.com/click33/sa-token/stargazers"><img src="https://img.shields.io/github/stars/click33/sa-token"></a> <a href="https://github.com/click33/sa-token/stargazers"><img src="https://img.shields.io/github/stars/click33/sa-token"></a>
<a href="https://github.com/click33/sa-token/watchers"><img src="https://img.shields.io/github/watchers/click33/sa-token"></a> <a href="https://github.com/click33/sa-token/watchers"><img src="https://img.shields.io/github/watchers/click33/sa-token"></a>
<a href="https://github.com/click33/sa-token/network/members"><img src="https://img.shields.io/github/forks/click33/sa-token"></a> <a href="https://github.com/click33/sa-token/network/members"><img src="https://img.shields.io/github/forks/click33/sa-token"></a>

View File

@@ -8,7 +8,7 @@
<groupId>cn.dev33</groupId> <groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId> <artifactId>sa-token-parent</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>1.15.0</version> <version>1.15.0.RELEASE</version>
<!-- 项目介绍 --> <!-- 项目介绍 -->
<name>sa-token</name> <name>sa-token</name>
@@ -23,7 +23,7 @@
<module>sa-token-dao-redis</module> <module>sa-token-dao-redis</module>
<module>sa-token-dao-redis-jackson</module> <module>sa-token-dao-redis-jackson</module>
<module>sa-token-spring-aop</module> <module>sa-token-spring-aop</module>
<module>sa-token-oauth2</module> <!-- <module>sa-token-oauth2</module> -->
</modules> </modules>
<!-- 开源协议 apache 2.0 --> <!-- 开源协议 apache 2.0 -->
@@ -38,7 +38,7 @@
<!-- 一些属性 --> <!-- 一些属性 -->
<properties> <properties>
<sa-token-version>1.15.0</sa-token-version> <sa-token-version>1.15.0.RELEASE</sa-token-version>
<jdk.version>1.8</jdk.version> <jdk.version>1.8</jdk.version>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding> <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>

View File

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

View File

@@ -136,8 +136,10 @@ public class SaTokenManager {
public static SaTokenServlet getSaTokenServlet() { public static SaTokenServlet getSaTokenServlet() {
if (saTokenServlet == null) { if (saTokenServlet == null) {
// 如果对象为空,则使用框架默认方式初始化 // 如果对象为空,则使用框架默认方式初始化
if (saTokenServlet == null) { synchronized (SaTokenManager.class) {
setSaTokenServlet(new SaTokenServletDefaultImpl()); if (saTokenServlet == null) {
setSaTokenServlet(new SaTokenServletDefaultImpl());
}
} }
} }
return saTokenServlet; return saTokenServlet;

View File

@@ -43,7 +43,7 @@ public class SaTokenActionDefaultImpl implements SaTokenAction {
return SaTokenInsideUtil.getRandomString(128); return SaTokenInsideUtil.getRandomString(128);
} }
// tik风格 (2_14_16) // tik风格 (2_14_16)
if(SaTokenConsts.TOKEN_STYLE_RANDOM_TIK.equals(tokenStyle)) { if(SaTokenConsts.TOKEN_STYLE_TIK.equals(tokenStyle)) {
return SaTokenInsideUtil.getRandomString(2) + "_" + SaTokenInsideUtil.getRandomString(14) + "_" + SaTokenInsideUtil.getRandomString(16) + "__"; return SaTokenInsideUtil.getRandomString(2) + "_" + SaTokenInsideUtil.getRandomString(14) + "_" + SaTokenInsideUtil.getRandomString(16) + "__";
} }
// 默认还是uuid // 默认还是uuid

View File

@@ -439,5 +439,4 @@ public class SaSecureUtil {
} }
} }

View File

@@ -426,6 +426,16 @@ public class SaSession implements Serializable {
public boolean has(String key) { public boolean has(String key) {
return !valueIsNull(get(key)); return !valueIsNull(get(key));
} }
/**
* 删值
* @param key 要删除的key
*/
public void delete(String key) {
dataMap.remove(key);
update();
}
// --------- 工具方法 // --------- 工具方法

View File

@@ -13,7 +13,7 @@ public class SaTokenConsts {
/** /**
* sa-token 版本号 * sa-token 版本号
*/ */
public static final String VERSION_NO = "v1.15.0"; public static final String VERSION_NO = "v1.15.0.RELEASE";
/** /**
* sa-token 开源地址 * sa-token 开源地址
@@ -74,7 +74,7 @@ public class SaTokenConsts {
/** /**
* token风格: tik风格 (2_14_16) * token风格: tik风格 (2_14_16)
*/ */
public static final String TOKEN_STYLE_RANDOM_TIK = "tik"; public static final String TOKEN_STYLE_TIK = "tik";
// =================== 其它 =================== // =================== 其它 ===================

View File

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

View File

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

View File

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

View File

@@ -17,7 +17,7 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<!-- 定义sa-token版本号 --> <!-- 定义sa-token版本号 -->
<sa-token-version>1.15.0</sa-token-version> <sa-token-version>1.15.0.RELEASE</sa-token-version>
</properties> </properties>
<dependencies> <dependencies>

View File

@@ -17,7 +17,7 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<!-- 定义sa-token版本号 --> <!-- 定义sa-token版本号 -->
<sa-token-version>1.15.0</sa-token-version> <sa-token-version>1.15.0.RELEASE</sa-token-version>
</properties> </properties>
<dependencies> <dependencies>

View File

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

View File

@@ -1,11 +1,11 @@
<p align="center"> <p align="center">
<img alt="logo" src="https://gitee.com/sz6/sa-token/raw/master/sa-token-doc/doc/logo.png" width="150" height="150"> <img alt="logo" src="https://gitee.com/sz6/sa-token/raw/master/sa-token-doc/doc/logo.png" width="150" height="150">
</p> </p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.15.0</h1> <h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.15.0.RELEASE</h1>
<h4 align="center">这可能是史上功能最全的Java权限认证框架</h4> <h4 align="center">这可能是史上功能最全的Java权限认证框架</h4>
<h4 align="center"> <h4 align="center">
<a href="https://gitee.com/sz6/sa-token/stargazers"><img src="https://gitee.com/sz6/sa-token/badge/star.svg"></a> <a href="https://gitee.com/sz6/sa-token/stargazers"><img src="https://gitee.com/sz6/sa-token/badge/star.svg"></a>
<a href="https://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.15.0-2B9939"></a> <a href="https://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.15.0.RELEASE-2B9939"></a>
<a href="https://github.com/click33/sa-token/stargazers"><img src="https://img.shields.io/github/stars/click33/sa-token"></a> <a href="https://github.com/click33/sa-token/stargazers"><img src="https://img.shields.io/github/stars/click33/sa-token"></a>
<a href="https://github.com/click33/sa-token/watchers"><img src="https://img.shields.io/github/watchers/click33/sa-token"></a> <a href="https://github.com/click33/sa-token/watchers"><img src="https://img.shields.io/github/watchers/click33/sa-token"></a>
<a href="https://github.com/click33/sa-token/network/members"><img src="https://img.shields.io/github/forks/click33/sa-token"></a> <a href="https://github.com/click33/sa-token/network/members"><img src="https://img.shields.io/github/forks/click33/sa-token"></a>

View File

@@ -44,7 +44,7 @@
</div> </div>
<script> <script>
var name = '<img style="width: 50px; height: 50px; vertical-align: middle;" src="logo.png" alt="logo" /> '; var name = '<img style="width: 50px; height: 50px; vertical-align: middle;" src="logo.png" alt="logo" /> ';
name += '<b style="font-size: 24px; vertical-align: middle;">sa-token</b> <sub>v1.15.0</sub>' name += '<b style="font-size: 24px; vertical-align: middle;">sa-token</b> <sub>v1.15.0.RELEASE</sub>'
window.$docsify = { window.$docsify = {
name: name, // 名字 name: name, // 名字
repo: 'https://github.com/click33/sa-token', // github地址 repo: 'https://github.com/click33/sa-token', // github地址

View File

@@ -9,14 +9,14 @@
<dependency> <dependency>
<groupId>cn.dev33</groupId> <groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId> <artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.15.0</version> <version>1.15.0.RELEASE</version>
</dependency> </dependency>
``` ```
## Gradle依赖 ## Gradle依赖
Gradle用户引入依赖 Gradle用户引入依赖
``` ```
implementation 'cn.dev33:sa-token-spring-boot-starter:1.15.0' implementation 'cn.dev33:sa-token-spring-boot-starter:1.15.0.RELEASE'
``` ```

View File

@@ -19,7 +19,7 @@
<dependency> <dependency>
<groupId>cn.dev33</groupId> <groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId> <artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.15.0</version> <version>1.15.0.RELEASE</version>
</dependency> </dependency>
``` ```

View File

@@ -21,7 +21,7 @@ sa-token内置两种模式完成注解鉴权分别是`AOP模式`和`拦截器
<dependency> <dependency>
<groupId>cn.dev33</groupId> <groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-aop</artifactId> <artifactId>sa-token-spring-aop</artifactId>
<version>1.15.0</version> <version>1.15.0.RELEASE</version>
</dependency> </dependency>
``` ```

View File

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

View File

@@ -41,7 +41,7 @@
<!-- 内容部分 --> <!-- 内容部分 -->
<div class="main-box"> <div class="main-box">
<div class="content-box"> <div class="content-box">
<h1>sa-token<small>v1.15.0</small></h1> <h1>sa-token<small>v1.15.0.RELEASE</small></h1>
<div class="sub-title">这可能是史上功能最全的java权限认证框架</div> <div class="sub-title">这可能是史上功能最全的java权限认证框架</div>
<!-- <p>0配置开箱即用低学习成本</p> --> <!-- <p>0配置开箱即用低学习成本</p> -->
<p>登录验证、权限验证、Session会话、踢人下线、集成Redis、分布式会话、单点登录、前后台分离、记住我模式、模拟他人账号、临时身份切换、多账号体系、注解式鉴权、路由拦截式鉴权、花式token、自动续签、同端互斥登录、会话治理、密码加密、jwt集成、Spring集成...</p> <p>登录验证、权限验证、Session会话、踢人下线、集成Redis、分布式会话、单点登录、前后台分离、记住我模式、模拟他人账号、临时身份切换、多账号体系、注解式鉴权、路由拦截式鉴权、花式token、自动续签、同端互斥登录、会话治理、密码加密、jwt集成、Spring集成...</p>

View File

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

View File

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

View File

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

View File

@@ -15,13 +15,19 @@ import cn.dev33.satoken.stp.StpUtil;
public class SaRouteInterceptor implements HandlerInterceptor { public class SaRouteInterceptor implements HandlerInterceptor {
/** /**
* 自定义模式下的执行函数 * 每次进入拦截器的[执行函数]
*/ */
public SaRouteFunction function; public SaRouteFunction function;
/** /**
* 创建 (默认为自定义认证) * 创建一个路由拦截器
* @param function 自定义模式下的执行函数 */
public SaRouteInterceptor() {
}
/**
* 创建, 并指定[执行函数]
* @param function [执行函数]
*/ */
public SaRouteInterceptor(SaRouteFunction function) { public SaRouteInterceptor(SaRouteFunction function) {
this.function = function; this.function = function;
@@ -50,6 +56,7 @@ public class SaRouteInterceptor implements HandlerInterceptor {
if(function == null) { if(function == null) {
StpUtil.checkLogin(); StpUtil.checkLogin();
} else { } else {
// 否则执行函数
function.run(request, response, handler); function.run(request, response, handler);
} }