Skip to content

Commit

Permalink
v1.14.0 更新
Browse files Browse the repository at this point in the history
  • Loading branch information
click33 committed Mar 11, 2021
1 parent 9fe0e1f commit f9ad71d
Show file tree
Hide file tree
Showing 28 changed files with 73 additions and 36 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<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">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.13.0</h1>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.14.0</h1>
<h4 align="center">这可能是史上功能最全的Java权限认证框架!</h4>
<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://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.13.0-2B9939"></a>
<a href="https://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.14.0-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/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>
Expand Down Expand Up @@ -87,7 +87,8 @@ StpUtil.checkLogin();
@SaCheckPermission("user:add")
@RequestMapping("/user/insert")
public String insert(SysUser user) {
return "用户增加";
// ...
return "用户增加";
}
```

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId>
<packaging>pom</packaging>
<version>1.13.0</version>
<version>1.14.0</version>

<!-- 项目介绍 -->
<name>sa-token</name>
Expand Down Expand Up @@ -38,7 +38,7 @@

<!-- 一些属性 -->
<properties>
<sa-token-version>1.13.0</sa-token-version>
<sa-token-version>1.14.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>
Expand Down
2 changes: 1 addition & 1 deletion sa-token-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId>
<version>1.13.0</version>
<version>1.14.0</version>
</parent>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static String encode(String text){

/**
* Base64解码,String 转 String
* @param text Base64格式字符串
* @param base64Text Base64格式字符串
* @return 字符串
*/
public static String decode(String base64Text){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class SaTokenConsts {
/**
* sa-token 版本号
*/
public static final String VERSION_NO = "v1.13.0";
public static final String VERSION_NO = "v1.14.0";

/**
* sa-token 开源地址
Expand Down
2 changes: 1 addition & 1 deletion sa-token-dao-redis-jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId>
<version>1.13.0</version>
<version>1.14.0</version>
</parent>
<packaging>jar</packaging>

Expand Down
2 changes: 1 addition & 1 deletion sa-token-dao-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId>
<version>1.13.0</version>
<version>1.14.0</version>
</parent>
<packaging>jar</packaging>

Expand Down
2 changes: 1 addition & 1 deletion sa-token-demo-jwt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.13.0</sa-token-version>
<sa-token-version>1.14.0</sa-token-version>
</properties>

<dependencies>
Expand Down
4 changes: 3 additions & 1 deletion sa-token-demo-oauth2/sa-token-demo-oauth2-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<properties>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<!-- 定义sa-token版本号 -->
<sa-token-version>1.14.0</sa-token-version>
</properties>

<dependencies>
Expand All @@ -30,7 +32,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.13.0</version>
<version>${sa-token-version}</version>
</dependency>

<!-- OkHttps网络请求库: http://okhttps.ejlchina.com/ -->
Expand Down
8 changes: 5 additions & 3 deletions sa-token-demo-oauth2/sa-token-demo-oauth2-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<properties>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<!-- 定义sa-token版本号 -->
<sa-token-version>1.14.0</sa-token-version>
</properties>

<dependencies>
Expand All @@ -30,21 +32,21 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.13.0</version>
<version>${sa-token-version}</version>
</dependency>

<!-- sa-token 实现 oauth2.0 -->
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-oauth2</artifactId>
<version>1.13.0-alpha</version>
<version>1.14.0-alpha</version>
</dependency>

<!-- sa-token整合redis (使用jackson序列化方式) -->
<!-- <dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis-jackson</artifactId>
<version>1.13.0</version>
<version>${sa-token-version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
2 changes: 1 addition & 1 deletion sa-token-demo-springboot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<!-- 定义sa-token版本号 -->
<properties>
<sa-token-version>1.13.0</sa-token-version>
<sa-token-version>1.14.0</sa-token-version>
</properties>

<dependencies>
Expand Down
7 changes: 4 additions & 3 deletions sa-token-doc/doc/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<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">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.13.0</h1>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.14.0</h1>
<h4 align="center">这可能是史上功能最全的Java权限认证框架!</h4>
<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://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.13.0-2B9939"></a>
<a href="https://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.14.0-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/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>
Expand Down Expand Up @@ -87,7 +87,8 @@ StpUtil.checkLogin();
@SaCheckPermission("user:add")
@RequestMapping("/user/insert")
public String insert(SysUser user) {
return "用户增加";
// ...
return "用户增加";
}
```

Expand Down
3 changes: 2 additions & 1 deletion sa-token-doc/doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ <h1 class="logo-text">sa-token</h1>
<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.13.0/doc/index.html">v1.13.0</option>
<option value="http://sa-token.dev33.cn/v/v1.12.1/doc/index.html">v1.12.1</option>
<option value="http://sa-token.dev33.cn/v/v1.12.0/doc/index.html">v1.12.0</option>
<option value="http://sa-token.dev33.cn/v/v1.11.0/doc/index.html">v1.11.0</option>
Expand All @@ -42,7 +43,7 @@ <h1 class="logo-text">sa-token</h1>
</div>
<script>
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.13.0</sub>'
name += '<b style="font-size: 24px; vertical-align: middle;">sa-token</b> <sub>v1.14.0</sub>'
window.$docsify = {
name: name, // 名字
repo: 'https://github.com/click33/sa-token', // github地址
Expand Down
17 changes: 17 additions & 0 deletions sa-token-doc/doc/more/update-log.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# 更新日志

### 2021-3-12 @v1.14.0
- 新增:新增`SaLoginModel`登录参数Model,适配 [记住我] 模式 **[重要]**
- 新增:新增 `StpUtil.setLoginId()` 时指定token有效期,可灵活控制用户的一次登录免验证时长
- 新增:新增Cookie时间判断,在`timeout`设置为-1时,`Cookie`有效期将为`Integer.MAX_VALUE` **[重要]**
- 新增:新增密码加密工具类,可快速MD5、SHA1、SHA256、AES、RSA加密 **[重要]**
- 新增:新增 OAuth2.0 模块 **[重要]**
- 新增:`SaTokenConfig`配置类所有set方法支持链式调用
- 新增:`SaOAuth2Config` sa-token oauth2 配置类所有set方法新增支持链式调用
- 优化:`StpLogic`类所有`getKey`方法重名为`splicingKey`,更语义化的函数名称
- 新增:`IsRunFunction`新增`noExe`函数,用于指定当`isRun`值为`false`时执行的函数
- 新增:`SaSession`新增数据存取值操作API
- 优化:优化`SaTokenDao`接口,增加Object操作API
- 优化:jwt示例`createToken`方法去除默认秘钥判断,只在启动项目时打印警告
- 文档:常见问题新增示例(修改密码后如何立即掉线)
- 文档:权限认证文档新增[如何把权限精确搭到按钮级]示例说明
- 文档:优化文档,部分模块添加图片说明


### 2021-2-9 @v1.13.0
- 优化:优化源码注释与文档
Expand Down
10 changes: 7 additions & 3 deletions sa-token-doc/doc/start/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.13.0</version>
<version>1.14.0</version>
</dependency>
```

## Gradle依赖
Gradle用户引入依赖:
```
implementation 'cn.dev33:sa-token-spring-boot-starter:1.13.0'
implementation 'cn.dev33:sa-token-spring-boot-starter:1.14.0'
```


Expand All @@ -34,8 +34,12 @@ implementation 'cn.dev33:sa-token-spring-boot-starter:1.13.0'
├── sa-token-dao-redis // sa-token整合redis (使用jdk默认序列化方式)
├── sa-token-dao-redis-jackson // sa-token整合redis (使用jackson序列化方式)
├── sa-token-spring-aop // sa-token整合SpringAOP 注解鉴权
├── sa-token-oauth2 // sa-token实现 OAuth2.0 模块(内测暂未发布)
├── sa-token-demo-springboot // sa-token示例
├── sa-token-demo-jwt // sa-token集成jwt示例
├── sa-token-demo-oauth2 // sa-token集成OAuth2.0模块示例
├── sa-token-demo-oauth2-client // OAuth2.0 客户端
├── sa-token-demo-oauth2-server // OAuth2.0 服务端
├── sa-token-doc // sa-token开发文档
├──pom.xml
```
Expand All @@ -46,7 +50,7 @@ implementation 'cn.dev33:sa-token-spring-boot-starter:1.13.0'
## jar包下载
[点击下载:sa-token-1.6.0.jar](https://oss.dev33.cn/sa-token/sa-token-1.6.0.jar)

(注意:当前仅提供`v1.6.0`版本jar包下载,更多版本请前往maven中央仓库获取)
(注意:当前仅提供`v1.6.0`版本jar包下载,更多版本请前往maven中央仓库获取[直达链接](https://search.maven.org/search?q=sa-token))



2 changes: 1 addition & 1 deletion sa-token-doc/doc/start/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.13.0</version>
<version>1.14.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion sa-token-doc/doc/use/at-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sa-token内置两种模式完成注解鉴权,分别是`AOP模式`和`拦截器
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-aop</artifactId>
<version>1.13.0</version>
<version>1.14.0</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions sa-token-doc/doc/use/dao-extend.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Sa-token默认将会话数据保存在内存中,此模式读写速度最快,
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis</artifactId>
<version>1.13.0</version>
<version>1.14.0</version>
</dependency>
```
优点:兼容性好,缺点:Session序列化后基本不可读,对开发者来讲等同于乱码
Expand All @@ -26,7 +26,7 @@ Sa-token默认将会话数据保存在内存中,此模式读写速度最快,
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis-jackson</artifactId>
<version>1.13.0</version>
<version>1.14.0</version>
</dependency>
```
优点:Session序列化后可读性强,可灵活手动修改,缺点:兼容性稍差
Expand Down
4 changes: 2 additions & 2 deletions sa-token-doc/doc/use/remember-me.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Cookie作为浏览器提供的默认会话跟踪机制,其生命周期有两
- 永久Cookie:有效期为一个具体的时间,在时间未到期之前,即使用户关闭了浏览器Cookie也不会消失

利用Cookie的此特性,我们便可以轻松实现 [记住我] 模式:
- 勾选[记住我]按钮时:调用`StpUtil.setLoginId(10001, true)`,在浏览器写入一个`永久Cookie`保存token,此时用户即使重启浏览器token依然有效
- 不勾选[记住我]按钮时:调用`StpUtil.setLoginId(10001, false)`,在浏览器写入一个`临时Cookie`保存token,此时用户在重启浏览器后token便会消失,导致会话失效
- 勾选[记住我]按钮时:调用`StpUtil.setLoginId(10001, true)`,在浏览器写入一个`永久Cookie`储存token,此时用户即使重启浏览器token依然有效
- 不勾选[记住我]按钮时:调用`StpUtil.setLoginId(10001, false)`,在浏览器写入一个`临时Cookie`储存token,此时用户在重启浏览器后token便会消失,导致会话失效


### 前后台分离模式下如何实现[记住我]?
Expand Down
2 changes: 1 addition & 1 deletion sa-token-doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<!-- 内容部分 -->
<div class="main-box">
<div class="content-box">
<h1>sa-token<small>v1.13.0</small></h1>
<h1>sa-token<small>v1.14.0</small></h1>
<div class="sub-title">这可能是史上功能最全的java权限认证框架!</div>
<!-- <p>0配置开箱即用,低学习成本</p> -->
<p>登录验证、权限验证、Session会话、踢人下线、集成Redis、分布式会话、单点登录、前后台分离、模拟他人账号、临时身份切换、多账号体系、注解式鉴权、路由拦截式鉴权、花式token、自动续签、同端互斥登录、会话治理、Spring集成...</p>
Expand Down
1 change: 1 addition & 0 deletions sa-token-oauth2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sa-token-oauth2 模块是 sa-token 实现 oauth2.0 的部分,目前该模块
3. 根据控制台打印,访问测试地址即可:[http://localhost:8002/login.html](http://localhost:8002/login.html)

可结合代码注释学习查看

4 changes: 2 additions & 2 deletions sa-token-oauth2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<parent>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-parent</artifactId>
<version>1.13.0</version>
<version>1.14.0</version>
</parent>
<packaging>jar</packaging>

<name>sa-token-dao-redis</name>
<artifactId>sa-token-oauth2</artifactId>
<version>1.13.0-alpha</version>
<version>1.14.0-alpha</version>
<description>sa-token realization oauth2.0</description>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ public default String getKeyCodeModel(String code) {
}

/**
* 获取key:[Client&账号]最新授权码记录, 持久化使用的key
* 获取key:[Client and 账号]最新授权码记录, 持久化使用的key
* @param loginId 账号id
* @param clientId 应用id
* @return key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static List<String> getGrantScopeList(Object loginId, String clientId) {
* @param clientId 应用id
* @param scope 权限
* @param loginId 账号id
* @return 是否已经授权
*/
public static boolean isGrant(Object loginId, String clientId, String scope) {
return SaOAuth2Manager.getInterface().isGrant(loginId, clientId, scope);
Expand Down
Loading

0 comments on commit f9ad71d

Please sign in to comment.