Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
shengzhang_
sa-token
提交
69d01e3e
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,发现更多精彩内容 >>
提交
69d01e3e
编写于
1月 05, 2021
作者:
shengzhang_
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
v1.9.0 版本更新
上级
82ee90f7
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
37 addition
and
25 deletion
+37
-25
README.md
README.md
+5
-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
+3
-3
sa-token-doc/doc/README.md
sa-token-doc/doc/README.md
+5
-2
sa-token-doc/doc/index.html
sa-token-doc/doc/index.html
+3
-2
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/dao-extend.md
sa-token-doc/doc/use/dao-extend.md
+2
-2
sa-token-doc/index.html
sa-token-doc/index.html
+3
-3
sa-token-spring-boot-starter/pom.xml
sa-token-spring-boot-starter/pom.xml
+2
-2
未找到文件。
README.md
浏览文件 @
69d01e3e
<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.
8
.0
</h1>
<h1
align=
"center"
style=
"margin: 30px 0 30px; font-weight: bold;"
>
sa-token v1.
9
.0
</h1>
<h4
align=
"center"
>
一个JavaWeb轻量级权限认证框架,功能全面,上手简单
</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.
8
.0-2B9939"
></a>
<a
href=
"https://github.com/click33/sa-token"
><img
src=
"https://img.shields.io/badge/sa--token-v1.
9
.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>
...
...
@@ -60,6 +60,8 @@ StpUtil.hasPermission("user:add"); // 查询当前账号是否含有指定权
StpUtil
.
getSession
();
// 获取当前账号id的Session
StpUtil
.
getSessionByLoginId
(
10001
);
// 获取账号id为10001的Session
StpUtil
.
getTokenValueByLoginId
(
10001
);
// 获取账号id为10001的token令牌值
StpUtil
.
setLoginId
(
10001
,
"PC"
);
// 指定设备标识登录
StpUtil
.
logoutByLoginId
(
10001
,
"PC"
);
// 指定设备标识进行强制注销 (不同端不受影响)
```
sa-token的API众多,请恕此处无法为您逐一展示,更多示例请戳官方在线文档
...
...
@@ -78,6 +80,7 @@ sa-token的API众多,请恕此处无法为您逐一展示,更多示例请戳
-
**注解式鉴权**
—— 优雅的将鉴权与业务代码分离
-
**花式token生成**
—— 内置六种token风格,还可自定义token生成策略
-
**自动续签**
—— 提供两种token过期策略,灵活搭配使用,还可自动续签
-
**同端互斥登录**
—— 像QQ一样手机电脑同时在线,但是两个手机上互斥登录
-
**组件自动注入**
—— 零配置与Spring等框架集成
-
**更多功能正在集成中...**
—— 如有您有好想法或者建议,欢迎加群交流
...
...
pom.xml
浏览文件 @
69d01e3e
...
...
@@ -8,7 +8,7 @@
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<packaging>
pom
</packaging>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
<!-- 项目介绍 -->
<name>
sa-token
</name>
...
...
sa-token-core/pom.xml
浏览文件 @
69d01e3e
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</parent>
<packaging>
jar
</packaging>
...
...
sa-token-core/src/main/java/cn/dev33/satoken/util/SaTokenConsts.java
浏览文件 @
69d01e3e
...
...
@@ -10,7 +10,7 @@ public class SaTokenConsts {
/**
* sa-token 版本号
*/
public
static
final
String
VERSION_NO
=
"v1.
8
.0"
;
public
static
final
String
VERSION_NO
=
"v1.
9
.0"
;
/**
* sa-token 开源地址
...
...
sa-token-dao-redis-jackson/pom.xml
浏览文件 @
69d01e3e
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</parent>
<packaging>
jar
</packaging>
...
...
@@ -20,7 +20,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</dependency>
<!-- RedisTemplate 相关操作API -->
<dependency>
...
...
sa-token-dao-redis/pom.xml
浏览文件 @
69d01e3e
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</parent>
<packaging>
jar
</packaging>
...
...
@@ -20,7 +20,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</dependency>
<!-- RedisTemplate 相关操作API -->
<dependency>
...
...
sa-token-demo-springboot/pom.xml
浏览文件 @
69d01e3e
...
...
@@ -29,21 +29,21 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</dependency>
<!-- sa-token整合redis (使用jdk默认序列化方式) -->
<!-- <dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis</artifactId>
<version>1.
8
.0</version>
<version>1.
9
.0</version>
</dependency> -->
<!-- sa-token整合redis (使用jackson序列化方式) -->
<!-- <dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-dao-redis-jackson</artifactId>
<version>1.
8
.0</version>
<version>1.
9
.0</version>
</dependency> -->
<!-- 提供redis连接池 -->
...
...
sa-token-doc/doc/README.md
浏览文件 @
69d01e3e
<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.
8
.0
</h1>
<h1
align=
"center"
style=
"margin: 30px 0 30px; font-weight: bold;"
>
sa-token v1.
9
.0
</h1>
<h4
align=
"center"
>
一个JavaWeb轻量级权限认证框架,功能全面,上手简单
</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.
8
.0-2B9939"
></a>
<a
href=
"https://github.com/click33/sa-token"
><img
src=
"https://img.shields.io/badge/sa--token-v1.
9
.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>
...
...
@@ -60,6 +60,8 @@ StpUtil.hasPermission("user:add"); // 查询当前账号是否含有指定权
StpUtil
.
getSession
();
// 获取当前账号id的Session
StpUtil
.
getSessionByLoginId
(
10001
);
// 获取账号id为10001的Session
StpUtil
.
getTokenValueByLoginId
(
10001
);
// 获取账号id为10001的token令牌值
StpUtil
.
setLoginId
(
10001
,
"PC"
);
// 指定设备标识登录
StpUtil
.
logoutByLoginId
(
10001
,
"PC"
);
// 指定设备标识进行强制注销 (不同端不受影响)
```
sa-token的API众多,请恕此处无法为您逐一展示,更多示例请戳官方在线文档
...
...
@@ -78,6 +80,7 @@ sa-token的API众多,请恕此处无法为您逐一展示,更多示例请戳
-
**注解式鉴权**
—— 优雅的将鉴权与业务代码分离
-
**花式token生成**
—— 内置六种token风格,还可自定义token生成策略
-
**自动续签**
—— 提供两种token过期策略,灵活搭配使用,还可自动续签
-
**同端互斥登录**
—— 像QQ一样手机电脑同时在线,但是两个手机上互斥登录
-
**组件自动注入**
—— 零配置与Spring等框架集成
-
**更多功能正在集成中...**
—— 如有您有好想法或者建议,欢迎加群交流
...
...
sa-token-doc/doc/index.html
浏览文件 @
69d01e3e
...
...
@@ -7,7 +7,7 @@
<meta
name=
"description"
content=
"Description"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<meta
name=
"keywords"
content=
"sa-token|sa-token框架|sa-token文档|sa-token在线文档|权限认证框架"
>
<meta
name=
"description"
content=
"sa-token是一个JavaWeb权限认证框架,功能全面,上手简单,登录验证、权限验证、Session会话、踢人下线、集成Redis、前后台分离、模拟他人账号、多账号体系、注解式鉴权、花式token、自动续签、Spring集成...,零配置开箱即用,覆盖所有应用场景,你所需要的功能,这里都有"
>
<meta
name=
"description"
content=
"sa-token是一个JavaWeb权限认证框架,功能全面,上手简单,登录验证、权限验证、Session会话、踢人下线、集成Redis、前后台分离、模拟他人账号、多账号体系、注解式鉴权、花式token、自动续签、
同端互斥登录、
Spring集成...,零配置开箱即用,覆盖所有应用场景,你所需要的功能,这里都有"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/docsify@4.11.3/lib/themes/vue.css"
>
<link
rel=
"stylesheet"
href=
"./lib/index.css"
>
<link
rel=
"shortcut icon"
type=
"image/x-icon"
href=
"logo.png"
>
...
...
@@ -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.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>
<option
value=
"http://sa-token.dev33.cn/v/v1.6.0/doc/index.html"
>
v1.6.0
</option>
<option
value=
"http://sa-token.dev33.cn/v/v1.5.1/doc/index.html"
>
v1.5.1
</option>
...
...
@@ -37,7 +38,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.
8
.0</sub>
'
name
+=
'
<b style="font-size: 24px; vertical-align: middle;">sa-token</b> <sub>v1.
9
.0</sub>
'
window
.
$docsify
=
{
name
:
name
,
// 名字
repo
:
'
https://github.com/click33/sa-token
'
,
// github地址
...
...
sa-token-doc/doc/more/update-log.md
浏览文件 @
69d01e3e
# 更新日志
### 2021-1-2 @v1.9.0
-
优化:
`spring-boot-starter-data-redis`
由
`2.3.7.RELEASE`
改为
`2.3.3.RELEASE`
-
修复:补上注解拦截器里漏掉验证@SaCheckRole的bug
-
新增:新增同端互斥登录,像QQ一样手机电脑同时在线,但是两个手机上互斥登录
### 2021-1-2 @v1.8.0
-
优化:优化源码注释
...
...
sa-token-doc/doc/start/download.md
浏览文件 @
69d01e3e
...
...
@@ -9,7 +9,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</dependency>
```
...
...
sa-token-doc/doc/start/example.md
浏览文件 @
69d01e3e
...
...
@@ -18,7 +18,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-spring-boot-starter
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</dependency>
```
...
...
sa-token-doc/doc/use/dao-extend.md
浏览文件 @
69d01e3e
...
...
@@ -11,7 +11,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-dao-redis
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</dependency>
```
优点:兼容性好,缺点:session序列化后基本不可读,对开发者来讲等同于乱码
...
...
@@ -23,7 +23,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-dao-redis-jackson
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</dependency>
```
优点:session序列化后可读性强,可灵活手动修改,缺点:兼容性稍差
...
...
sa-token-doc/index.html
浏览文件 @
69d01e3e
...
...
@@ -7,7 +7,7 @@
<meta
name=
"description"
content=
"Description"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<meta
name=
"keywords"
content=
"sa-token|sa-token框架|sa-token文档|sa-token在线文档|权限认证框架"
>
<meta
name=
"description"
content=
"sa-token是一个JavaWeb权限认证框架,功能全面,上手简单,登录验证、权限验证、Session会话、踢人下线、集成Redis、前后台分离、模拟他人账号、多账号体系、注解式鉴权、花式token、自动续签、Spring集成...,零配置开箱即用,覆盖所有应用场景,你所需要的功能,这里都有"
>
<meta
name=
"description"
content=
"sa-token是一个JavaWeb权限认证框架,功能全面,上手简单,登录验证、权限验证、Session会话、踢人下线、集成Redis、前后台分离、模拟他人账号、多账号体系、注解式鉴权、花式token、自动续签、
同端互斥登录、
Spring集成...,零配置开箱即用,覆盖所有应用场景,你所需要的功能,这里都有"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/docsify@4.11.3/lib/themes/vue.css"
>
<link
rel=
"shortcut icon"
type=
"image/x-icon"
href=
"doc/logo.png"
>
<link
rel=
"stylesheet"
href=
"index.css"
>
...
...
@@ -43,10 +43,10 @@
<!-- 内容部分 -->
<div
class=
"main-box"
>
<div
class=
"content-box"
>
<h1>
sa-token
<small>
v1.
8
.0
</small></h1>
<h1>
sa-token
<small>
v1.
9
.0
</small></h1>
<div
class=
"sub-title"
>
一个JavaWeb轻量级权限认证框架,功能全面,上手简单
</div>
<!-- <p>0配置开箱即用,低学习成本</p> -->
<p>
登录验证、权限验证、Session会话、踢人下线、集成Redis、前后台分离、模拟他人账号、多账号体系、注解式鉴权、花式token、自动续签、Spring集成...
</p>
<p>
登录验证、权限验证、Session会话、踢人下线、集成Redis、前后台分离、模拟他人账号、多账号体系、注解式鉴权、花式token、自动续签、
同端互斥登录、
Spring集成...
</p>
<p>
零配置开箱即用,覆盖所有应用场景,你所需要的功能,这里都有
</p>
<div
class=
"btn-box"
>
<a
href=
"https://github.com/click33/sa-token"
target=
"_blank"
>
GitHub
</a>
...
...
sa-token-spring-boot-starter/pom.xml
浏览文件 @
69d01e3e
...
...
@@ -7,7 +7,7 @@
<parent>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-parent
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.0
</version>
</parent>
<packaging>
jar
</packaging>
...
...
@@ -19,7 +19,7 @@
<dependency>
<groupId>
cn.dev33
</groupId>
<artifactId>
sa-token-core
</artifactId>
<version>
1.
8
.0
</version>
<version>
1.
9
.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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录