Skip to content

Commit

Permalink
v1.11.0更新
Browse files Browse the repository at this point in the history
  • Loading branch information
click33 committed Jan 9, 2021
1 parent 2d3a262 commit 600cc98
Show file tree
Hide file tree
Showing 20 changed files with 84 additions and 33 deletions.
4 changes: 2 additions & 2 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" style="margin-bottom: 10px;">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.10.0</h1>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.11.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.10.0-2B9939"></a>
<a href="https://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.11.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
2 changes: 1 addition & 1 deletion 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.10.0</version>
<version>1.11.0</version>

<!-- 项目介绍 -->
<name>sa-token</name>
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.10.0</version>
<version>1.11.0</version>
</parent>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class SaTokenConsts {
/**
* sa-token 版本号
*/
public static final String VERSION_NO = "v1.10.0";
public static final String VERSION_NO = "v1.11.0";

/**
* sa-token 开源地址
Expand Down
4 changes: 2 additions & 2 deletions 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.10.0</version>
<version>1.11.0</version>
</parent>
<packaging>jar</packaging>

Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>
<!-- RedisTemplate 相关操作API -->
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions 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.10.0</version>
<version>1.11.0</version>
</parent>
<packaging>jar</packaging>

Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>
<!-- RedisTemplate 相关操作API -->
<dependency>
Expand Down
10 changes: 5 additions & 5 deletions sa-token-demo-springboot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>

<!-- sa-token整合redis (使用jdk默认序列化方式) -->
<!-- <dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency> -->

<!-- sa-token整合redis (使用jackson序列化方式) -->
<!-- <dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis-jackson</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency> -->

<!-- 提供redis连接池 -->
Expand All @@ -52,11 +52,11 @@
<artifactId>commons-pool2</artifactId>
</dependency> -->

<!-- sa-token整合SpringAop实现注解鉴权 -->
<!-- sa-token整合SpringAOP实现注解鉴权 -->
<!-- <dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-aop</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency> -->

<!-- @ConfigurationProperties -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*
*/
@Service
//@SaCheckLogin
public class TestService {

@SaCheckLogin
Expand Down
4 changes: 2 additions & 2 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" style="margin-bottom: 10px;">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.10.0</h1>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">sa-token v1.11.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.10.0-2B9939"></a>
<a href="https://github.com/click33/sa-token"><img src="https://img.shields.io/badge/sa--token-v1.11.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
3 changes: 2 additions & 1 deletion sa-token-doc/doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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.10.0/doc/index.html">v1.10.0</option>
<option value="http://sa-token.dev33.cn/v/v1.9.0/doc/index.html">v1.9.0</option>
<option value="http://sa-token.dev33.cn/v/v1.8.0/doc/index.html">v1.8.0</option>
<option value="http://sa-token.dev33.cn/v/v1.7.0/doc/index.html">v1.7.0</option>
Expand All @@ -39,7 +40,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.10.0</sub>'
name += '<b style="font-size: 24px; vertical-align: middle;">sa-token</b> <sub>v1.11.0</sub>'
window.$docsify = {
name: name, // 名字
repo: 'https://github.com/click33/sa-token', // github地址
Expand Down
5 changes: 5 additions & 0 deletions sa-token-doc/doc/more/update-log.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# 更新日志


### 2021-1-9 @v1.11.0
- 新增:提供AOP注解鉴权方案 **[重要]**
- 优化自动生成token的算法


### 2021-1-9 @v1.10.0
- 新增:提供查询所有会话方案 **[重要]**
- 修复:修复token设置为永不过期时无法正常被顶下线的bug,感谢github用户 @zjh599245299 提出的bug
Expand Down
2 changes: 1 addition & 1 deletion sa-token-doc/doc/start/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>
```

Expand Down
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 @@ -18,7 +18,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>
```

Expand Down
48 changes: 45 additions & 3 deletions sa-token-doc/doc/use/at-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,51 @@
```


- mode有两种取值:
- `SaMode.AND`, 标注一组权限,会话必须全部具有才可通过校验
- `SaMode.OR`, 标注一组权限,会话只要具有其一即可通过校验
mode有两种取值:
- `SaMode.AND`, 标注一组权限,会话必须全部具有才可通过校验
- `SaMode.OR`, 标注一组权限,会话只要具有其一即可通过校验




## 4、AOP模式使用注解

使用拦截器方式,只能把注解加到`Controller层`上,那么如果我想把注解写到项目的任意位置,比如`Service层`,应该怎么办? <br>
很简单,你只需要将拦截器模式更换为`SpringAOP模式`即可, 在`pom.xml`里添加

``` xml
<!-- sa-token整合SpringAOP实现注解鉴权 -->
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-aop</artifactId>
<version>1.11.0</version>
</dependency>
```

然后你就可以在任意地方使用注解鉴权,例如:
``` java
@Service
public class UserService {
@SaCheckLogin
public List<String> getList() {
System.out.println("getList");
return new ArrayList<String>();
}
}
```


**注意:拦截器模式和AOP模式不可同时集成,否则会在Controller层发生一个注解校验两次的bug**













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 @@ -11,7 +11,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>
```
优点:兼容性好,缺点:session序列化后基本不可读,对开发者来讲等同于乱码
Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis-jackson</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>
```
优点:session序列化后可读性强,可灵活手动修改,缺点:兼容性稍差
Expand Down
6 changes: 5 additions & 1 deletion sa-token-doc/doc/use/search-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ StpUtil.searchTokenSessionId(String keyword, int start, int size);

使用示例:
``` java
StpUtil.searchTokenValue("1000", 0, 10); // 查询value包括1000的所有token,结果集从第0条开始,返回10条
// 查询value包括1000的所有token,结果集从第0条开始,返回10条
List<String> tokenList = StpUtil.searchTokenValue("1000", 0, 10);
for (String token : tokenList) {
System.out.println(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 @@ -43,7 +43,7 @@
<!-- 内容部分 -->
<div class="main-box">
<div class="content-box">
<h1>sa-token<small>v1.10.0</small></h1>
<h1>sa-token<small>v1.11.0</small></h1>
<div class="sub-title">一个JavaWeb轻量级权限认证框架,功能全面,上手简单</div>
<!-- <p>0配置开箱即用,低学习成本</p> -->
<p>登录验证、权限验证、Session会话、踢人下线、集成Redis、前后台分离、模拟他人账号、多账号体系、注解式鉴权、花式token、自动续签、同端互斥登录、会话治理、Spring集成...</p>
Expand Down
4 changes: 2 additions & 2 deletions sa-token-spring-aop/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.10.0</version>
<version>1.11.0</version>
</parent>
<packaging>jar</packaging>

Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>
<!-- spring-boot-starter-aop -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public SaCheckAspect() {
}

/**
* 定义AOP签名 --> (切入所有使用sa-token鉴权注解的方法)
* 定义AOP签名 (切入所有使用sa-token鉴权注解的方法)
*/
public static final String POINTCUT_SIGN = "@within(cn.dev33.satoken.annotation.SaCheckLogin) || @annotation(cn.dev33.satoken.annotation.SaCheckLogin) || "
+ "@within(cn.dev33.satoken.annotation.SaCheckRole) || @annotation(cn.dev33.satoken.annotation.SaCheckRole) || "
Expand All @@ -48,7 +48,7 @@ public void pointcut() {
* 环绕切入
* @param joinPoint 切面对象
* @return 底层方法执行后的返回值
* @throws Throwable
* @throws Throwable 底层方法抛出的异常
*/
@Around("pointcut()")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
Expand Down
4 changes: 2 additions & 2 deletions sa-token-spring-boot-starter/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.10.0</version>
<version>1.11.0</version>
</parent>
<packaging>jar</packaging>

Expand All @@ -19,7 +19,7 @@
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-core</artifactId>
<version>1.10.0</version>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down

0 comments on commit 600cc98

Please sign in to comment.