mirror of
https://gitee.com/dromara/sa-token.git
synced 2026-02-27 16:50:24 +08:00
优化文档
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
------
|
||||
|
||||
## Maven依赖
|
||||
在项目中直接通过 `pom.xml` 引入 `sa-token` 的依赖即可(四选一):
|
||||
在项目中直接通过 `pom.xml` 引入 Sa-Token 的依赖即可(四选一):
|
||||
|
||||
<!------------------------------ tabs:start ------------------------------>
|
||||
|
||||
<!-- tab:SpringMVC环境 (ServletAPI) -->
|
||||
如果你使用的框架基于 ServletAPI 构建( `SpringMVC`、`SpringBoot`、`Zuul`等 ),请引入此包
|
||||
如果你使用的框架基于 ServletAPI 构建( SpringMVC、SpringBoot、Zuul等 ),请引入此包
|
||||
``` xml
|
||||
<!-- Sa-Token 权限认证, 在线文档:http://sa-token.dev33.cn/ -->
|
||||
<dependency>
|
||||
@@ -19,7 +19,7 @@
|
||||
```
|
||||
|
||||
<!-- tab:WebFlux环境 (Reactor) -->
|
||||
注:如果你使用的框架基于 Reactor 模型构建(`Netty`、`WebFlux`、`Soul`、`SC Gateway`等),请引入此包
|
||||
注:如果你使用的框架基于 Reactor 模型构建(Netty、WebFlux、Soul、SC Gateway等),请引入此包
|
||||
``` xml
|
||||
<!-- Sa-Token 权限认证(Reactor响应式集成), 在线文档:http://sa-token.dev33.cn/ -->
|
||||
<dependency>
|
||||
@@ -30,7 +30,7 @@
|
||||
```
|
||||
|
||||
<!-- tab:Servlet容器环境 -->
|
||||
注:如果你的项目没有使用Spring,但是Web框架是基于`ServletAPI`规范的,可以引入此包
|
||||
注:如果你的项目没有使用Spring,但是Web框架是基于 ServletAPI 规范的,可以引入此包
|
||||
``` xml
|
||||
<!-- Sa-Token 权限认证(ServletAPI规范), 在线文档:http://sa-token.dev33.cn/ -->
|
||||
<dependency>
|
||||
@@ -41,7 +41,7 @@
|
||||
```
|
||||
|
||||
<!-- tab:其它 -->
|
||||
注:如果你的项目既没有使用`SpringMVC`、`WebFlux`,也不是基于`ServletAPI`规范,那么可以引入`core`核心包
|
||||
注:如果你的项目既没有使用 SpringMVC、WebFlux,也不是基于 ServletAPI 规范,那么可以引入core核心包
|
||||
``` xml
|
||||
<!-- Sa-Token 权限认证(core核心包), 在线文档:http://sa-token.dev33.cn/ -->
|
||||
<dependency>
|
||||
@@ -78,8 +78,8 @@ implementation 'cn.dev33:sa-token-core:1.20.0'
|
||||
|
||||
## 获取源码
|
||||
如果你想深入了解Sa-Token,你可以通过`Gitee`或者`GitHub`来获取源码 (**学习测试请拉取master分支**,dev为正在开发的分支,有很多特性并不稳定)
|
||||
- Gitee地址:[https://gitee.com/dromara/sa-token](https://gitee.com/dromara/sa-token)
|
||||
- GitHub地址:[https://github.com/dromara/sa-token](https://github.com/dromara/sa-token)
|
||||
- **Gitee**地址:[https://gitee.com/dromara/sa-token](https://gitee.com/dromara/sa-token)
|
||||
- **GitHub**地址:[https://github.com/dromara/sa-token](https://github.com/dromara/sa-token)
|
||||
- 开源不易,求鼓励,给个`star`吧
|
||||
- 源码目录介绍:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# SpringBoot 集成 Sa-Token 示例
|
||||
|
||||
本篇将带你从零开始集成sa-token,从而让你快速熟悉sa-token的使用姿势 <br>
|
||||
本篇将带你从零开始集成Sa-Token,从而让你快速熟悉Sa-Token的使用姿势 <br>
|
||||
整合示例在官方仓库的`/sa-token-demo/sa-token-demo-springboot`文件夹下,如遇到难点可结合源码进行测试学习
|
||||
|
||||
---
|
||||
@@ -31,7 +31,7 @@ server:
|
||||
port: 8081
|
||||
|
||||
spring:
|
||||
# sa-token配置
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
# token名称 (同时也是cookie名称)
|
||||
token-name: satoken
|
||||
@@ -61,7 +61,7 @@ spring:
|
||||
public class SaTokenDemoApplication {
|
||||
public static void main(String[] args) throws JsonProcessingException {
|
||||
SpringApplication.run(SaTokenDemoApplication.class, args);
|
||||
System.out.println("启动成功:sa-token配置如下:" + SaManager.getConfig());
|
||||
System.out.println("启动成功:Sa-Token配置如下:" + SaManager.getConfig());
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -106,7 +106,7 @@ public class UserController {
|
||||
|
||||
|
||||
### 详细了解
|
||||
通过这个示例,你已经对sa-token有了初步的了解,那么现在开始详细了解一下它都有哪些 [能力](/use/login-auth) 吧
|
||||
通过这个示例,你已经对Sa-Token有了初步的了解,那么现在开始详细了解一下它都有哪些 [能力](/use/login-auth) 吧
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Spring WebFlux 集成 Sa-Token 示例
|
||||
|
||||
WebFlux基于Reactor响应式模型开发,有着与标准ServletAPI完全不同的底层架构,因此要适配WebFlux, 必须提供与Reactor相关的整合实现,
|
||||
本篇将以WebFlux为例,展示sa-token与Reactor响应式模型web框架相整合的示例, **你可以用同样方式去对接其它Reactor模型Web框架**(Netty、Soul、Gateway等)
|
||||
本篇将以WebFlux为例,展示Sa-Token与Reactor响应式模型web框架相整合的示例, **你可以用同样方式去对接其它Reactor模型Web框架**(Netty、Soul、Gateway等)
|
||||
|
||||
整合示例在官方仓库的`/sa-token-demo/sa-token-demo-webflux`文件夹下,如遇到难点可结合源码进行测试学习
|
||||
|
||||
@@ -32,7 +32,7 @@ WebFlux基于Reactor响应式模型开发,有着与标准ServletAPI完全不
|
||||
public class SaTokenDemoApplication {
|
||||
public static void main(String[] args) throws JsonProcessingException {
|
||||
SpringApplication.run(SaTokenDemoApplication.class, args);
|
||||
System.out.println("启动成功:sa-token配置如下:" + SaManager.getConfig());
|
||||
System.out.println("启动成功:Sa-Token配置如下:" + SaManager.getConfig());
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -46,7 +46,7 @@ public class SaTokenDemoApplication {
|
||||
@Configuration
|
||||
public class SaTokenConfigure {
|
||||
/**
|
||||
* 注册 [sa-token全局过滤器]
|
||||
* 注册 [Sa-Token全局过滤器]
|
||||
*/
|
||||
@Bean
|
||||
public SaReactorFilter getSaReactorFilter() {
|
||||
|
||||
Reference in New Issue
Block a user