Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
shengzhang_
sa-token
提交
600cc98e
sa-token
项目概览
shengzhang_
/
sa-token
通知
68
Star
16
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
sa-token
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
600cc98e
编写于
1月 10, 2021
作者:
shengzhang_
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
v1.11.0更新
上级
2d3a262e
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
84 addition
and
33 deletion
+84
-33
README.md
README.md
+2
-2
pom.xml
pom.xml
+1
-1
sa-token-core/pom.xml
sa-token-core/pom.xml
+1
-1
sa-token-core/src/main/java/cn/dev33/satoken/util/SaTokenConsts.java
...re/src/main/java/cn/dev33/satoken/util/SaTokenConsts.java
+1
-1
sa-token-dao-redis-jackson/pom.xml
sa-token-dao-redis-jackson/pom.xml
+2
-2
sa-token-dao-redis/pom.xml
sa-token-dao-redis/pom.xml
+2
-2
sa-token-demo-springboot/pom.xml
sa-token-demo-springboot/pom.xml
+5
-5
sa-token-demo-springboot/src/main/java/com/pj/test/TestService.java
...emo-springboot/src/main/java/com/pj/test/TestService.java
+0
-1
sa-token-doc/doc/README.md
sa-token-doc/doc/README.md
+2
-2
sa-token-doc/doc/index.html
sa-token-doc/doc/index.html
+2
-1
sa-token-doc/doc/more/update-log.md
sa-token-doc/doc/more/update-log.md
+5
-0
sa-token-doc/doc/start/download.md
sa-token-doc/doc/start/download.md
+1
-1
sa-token-doc/doc/start/example.md
sa-token-doc/doc/start/example.md
+1
-1
sa-token-doc/doc/use/at-check.md
sa-token-doc/doc/use/at-check.md
+45
-3
sa-token-doc/doc/use/dao-extend.md
sa-token-doc/doc/use/dao-extend.md
+2
-2
sa-token-doc/doc/use/search-session.md
sa-token-doc/doc/use/search-session.md
+5
-1
sa-token-doc/index.html
sa-token-doc/index.html
+1
-1
sa-token-spring-aop/pom.xml
sa-token-spring-aop/pom.xml
+2
-2
sa-token-spring-aop/src/main/java/cn/dev33/satoken/aop/SaCheckAspect.java
...aop/src/main/java/cn/dev33/satoken/aop/SaCheckAspect.java
+2
-2
sa-token-spring-boot-starter/pom.xml
sa-token-spring-boot-starter/pom.xml
+2
-2
未找到文件。
README.md
浏览文件 @
600cc98e
<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.1
0
.0
</h1>
<h1
align=
"center"
style=
"margin: 30px 0 30px; font-weight: bold;"
>
sa-token v1.1
1
.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.1
0
.0-2B9939"
></a>
<a
href=
"https://github.com/click33/sa-token"
><img
src=
"https://img.shields.io/badge/sa--token-v1.1
1
.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>
...
...
pom.xml
浏览文件 @
600cc98e
...
...
@@ -8,7 +8,7 @@
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<packaging>
pom
</packaging>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
<!-- 项目介绍 -->
<name>
sa-token
</name>
...
...
sa-token-core/pom.xml
浏览文件 @
600cc98e
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</parent>
<packaging>
jar
</packaging>
...
...
sa-token-core/src/main/java/cn/dev33/satoken/util/SaTokenConsts.java
浏览文件 @
600cc98e
...
...
@@ -10,7 +10,7 @@ public class SaTokenConsts {
/**
* sa-token 版本号
*/
public
static
final
String
VERSION_NO
=
"v1.1
0
.0"
;
public
static
final
String
VERSION_NO
=
"v1.1
1
.0"
;
/**
* sa-token 开源地址
...
...
sa-token-dao-redis-jackson/pom.xml
浏览文件 @
600cc98e
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</parent>
<packaging>
jar
</packaging>
...
...
@@ -20,7 +20,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</dependency>
<!-- RedisTemplate 相关操作API -->
<dependency>
...
...
sa-token-dao-redis/pom.xml
浏览文件 @
600cc98e
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</parent>
<packaging>
jar
</packaging>
...
...
@@ -20,7 +20,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</dependency>
<!-- RedisTemplate 相关操作API -->
<dependency>
...
...
sa-token-demo-springboot/pom.xml
浏览文件 @
600cc98e
...
...
@@ -29,21 +29,21 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</dependency>
<!-- sa-token整合redis (使用jdk默认序列化方式) -->
<!-- <dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis</artifactId>
<version>1.1
0
.0</version>
<version>1.1
1
.0</version>
</dependency> -->
<!-- sa-token整合redis (使用jackson序列化方式) -->
<!-- <dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis-jackson</artifactId>
<version>1.1
0
.0</version>
<version>1.1
1
.0</version>
</dependency> -->
<!-- 提供redis连接池 -->
...
...
@@ -52,11 +52,11 @@
<artifactId>commons-pool2</artifactId>
</dependency> -->
<!-- sa-token整合SpringA
op
实现注解鉴权 -->
<!-- sa-token整合SpringA
OP
实现注解鉴权 -->
<!-- <dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-aop</artifactId>
<version>1.1
0
.0</version>
<version>1.1
1
.0</version>
</dependency> -->
<!-- @ConfigurationProperties -->
...
...
sa-token-demo-springboot/src/main/java/com/pj/test/TestService.java
浏览文件 @
600cc98e
...
...
@@ -14,7 +14,6 @@ import cn.dev33.satoken.annotation.SaCheckLogin;
*
*/
@Service
//@SaCheckLogin
public
class
TestService
{
@SaCheckLogin
...
...
sa-token-doc/doc/README.md
浏览文件 @
600cc98e
<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.1
0
.0
</h1>
<h1
align=
"center"
style=
"margin: 30px 0 30px; font-weight: bold;"
>
sa-token v1.1
1
.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.1
0
.0-2B9939"
></a>
<a
href=
"https://github.com/click33/sa-token"
><img
src=
"https://img.shields.io/badge/sa--token-v1.1
1
.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>
...
...
sa-token-doc/doc/index.html
浏览文件 @
600cc98e
...
...
@@ -22,6 +22,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.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>
...
...
@@ -39,7 +40,7 @@
</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.1
0
.0</sub>
'
name
+=
'
<b style="font-size: 24px; vertical-align: middle;">sa-token</b> <sub>v1.1
1
.0</sub>
'
window
.
$docsify
=
{
name
:
name
,
// 名字
repo
:
'
https://github.com/click33/sa-token
'
,
// github地址
...
...
sa-token-doc/doc/more/update-log.md
浏览文件 @
600cc98e
# 更新日志
### 2021-1-9 @v1.11.0
-
新增:提供AOP注解鉴权方案
**[重要]**
-
优化自动生成token的算法
### 2021-1-9 @v1.10.0
-
新增:提供查询所有会话方案
**[重要]**
-
修复:修复token设置为永不过期时无法正常被顶下线的bug,感谢github用户 @zjh599245299 提出的bug
...
...
sa-token-doc/doc/start/download.md
浏览文件 @
600cc98e
...
...
@@ -9,7 +9,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</dependency>
```
...
...
sa-token-doc/doc/start/example.md
浏览文件 @
600cc98e
...
...
@@ -18,7 +18,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</dependency>
```
...
...
sa-token-doc/doc/use/at-check.md
浏览文件 @
600cc98e
...
...
@@ -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**
...
...
sa-token-doc/doc/use/dao-extend.md
浏览文件 @
600cc98e
...
...
@@ -11,7 +11,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-dao-redis
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</dependency>
```
优点:兼容性好,缺点:session序列化后基本不可读,对开发者来讲等同于乱码
...
...
@@ -23,7 +23,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-dao-redis-jackson
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</dependency>
```
优点:session序列化后可读性强,可灵活手动修改,缺点:兼容性稍差
...
...
sa-token-doc/doc/use/search-session.md
浏览文件 @
600cc98e
...
...
@@ -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
);
}
```
...
...
sa-token-doc/index.html
浏览文件 @
600cc98e
...
...
@@ -43,7 +43,7 @@
<!-- 内容部分 -->
<div
class=
"main-box"
>
<div
class=
"content-box"
>
<h1>
sa-token
<small>
v1.1
0
.0
</small></h1>
<h1>
sa-token
<small>
v1.1
1
.0
</small></h1>
<div
class=
"sub-title"
>
一个JavaWeb轻量级权限认证框架,功能全面,上手简单
</div>
<!-- <p>0配置开箱即用,低学习成本</p> -->
<p>
登录验证、权限验证、Session会话、踢人下线、集成Redis、前后台分离、模拟他人账号、多账号体系、注解式鉴权、花式token、自动续签、同端互斥登录、会话治理、Spring集成...
</p>
...
...
sa-token-spring-aop/pom.xml
浏览文件 @
600cc98e
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</parent>
<packaging>
jar
</packaging>
...
...
@@ -20,7 +20,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</dependency>
<!-- spring-boot-starter-aop -->
<dependency>
...
...
sa-token-spring-aop/src/main/java/cn/dev33/satoken/aop/SaCheckAspect.java
浏览文件 @
600cc98e
...
...
@@ -31,7 +31,7 @@ public class 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) || "
...
...
@@ -48,7 +48,7 @@ public class SaCheckAspect {
* 环绕切入
* @param joinPoint 切面对象
* @return 底层方法执行后的返回值
* @throws Throwable
* @throws Throwable
底层方法抛出的异常
*/
@Around
(
"pointcut()"
)
public
Object
around
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
...
...
sa-token-spring-boot-starter/pom.xml
浏览文件 @
600cc98e
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</parent>
<packaging>
jar
</packaging>
...
...
@@ -19,7 +19,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-core
</artifactId>
<version>
1.1
0
.0
</version>
<version>
1.1
1
.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录