mirror of
https://gitee.com/dromara/sa-token.git
synced 2026-02-27 16:50:24 +08:00
v1.8.0更新
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
|
||||
------
|
||||
|
||||
## maven依赖
|
||||
## Maven依赖
|
||||
在项目中直接通过 `pom.xml` 导入 `sa-token` 的依赖即可
|
||||
``` xml
|
||||
<!-- sa-token 权限认证, 在线文档:http://sa-token.dev33.cn/ -->
|
||||
<dependency>
|
||||
<groupId>cn.dev33</groupId>
|
||||
<artifactId>sa-token-spring-boot-starter</artifactId>
|
||||
<version>1.7.0</version>
|
||||
<version>1.8.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
@@ -21,11 +21,18 @@
|
||||
- github地址:[https://github.com/click33/sa-token](https://github.com/click33/sa-token)
|
||||
- gitee地址:[https://gitee.com/sz6/sa-token](https://gitee.com/sz6/sa-token)
|
||||
- 开源不易,求鼓励,给个`star`吧
|
||||
- 源码目录介绍
|
||||
- `sa-token-dev`: 源码
|
||||
- `sa-token-spring-boot-starter`: springboot插件化集成
|
||||
- `sa-token-demo-springboot`: springboot集成示例
|
||||
- `sa-token-doc`: 文档介绍
|
||||
- 源码目录介绍:
|
||||
```
|
||||
── sa-token
|
||||
├── sa-token-core // sa-token核心模块
|
||||
├── sa-token-spring-boot-starter // sa-token整合springboot快速集成
|
||||
├── sa-token-dao-redis // sa-token整合redis (使用jdk默认序列化方式)
|
||||
├── sa-token-dao-redis-jackson // sa-token整合redis (使用jackson序列化方式)
|
||||
├── sa-token-demo-springboot // sa-token示例
|
||||
├── sa-token-doc // sa-token开发文档
|
||||
├──pom.xml
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>cn.dev33</groupId>
|
||||
<artifactId>sa-token-spring-boot-starter</artifactId>
|
||||
<version>1.7.0</version>
|
||||
<version>1.8.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
@@ -34,20 +34,14 @@ spring:
|
||||
token-name: satoken
|
||||
# token有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token临时有效期, 默认-1 代表不限制
|
||||
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
activity-timeout: -1
|
||||
# 在多人登录同一账号时,是否共享会话 (为true时共用一个,为false时新登录挤掉旧登录)
|
||||
is-share: true
|
||||
# 是否尝试从请求体里读取token
|
||||
is-read-body: true
|
||||
# 是否尝试从header里读取token
|
||||
is-read-head: true
|
||||
# 是否尝试从cookie里读取token
|
||||
is-read-cookie: true
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
allow-concurrent-login: false
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# token风格
|
||||
token-style: uuid
|
||||
# 是否在初始化配置时打印版本字符画
|
||||
is-v: true
|
||||
```
|
||||
|
||||
> - 如果你习惯于 `application.properties` 类型的配置文件,那也很好办:
|
||||
@@ -60,7 +54,7 @@ spring:
|
||||
@SpringBootApplication
|
||||
public class SaTokenDemoApplication {
|
||||
public static void main(String[] args) throws JsonProcessingException {
|
||||
SpringApplication.run(SaTokenDemoApplication.class, args); // run-->
|
||||
SpringApplication.run(SaTokenDemoApplication.class, args);
|
||||
System.out.println("启动成功:sa-token配置如下:" + SaTokenManager.getConfig());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user