mirror of
https://gitee.com/dromara/sa-token.git
synced 2026-05-14 04:42:09 +08:00
docs: 图片地址更换为本地文件 (插件篇)
This commit is contained in:
@@ -7,7 +7,7 @@ Sa-Token默认的Redis集成方式会把权限数据和业务缓存放在一起
|
||||
> 搭建两个Redis服务器,一个专门用来做业务缓存,另一台专门存放Sa-Token权限数据
|
||||
|
||||
|
||||
<button class="show-img" img-src="https://oss.dev33.cn/sa-token/doc/g/g3--alone-redis.gif">加载动态演示图</button>
|
||||
<button class="show-img" img-src="/big-file/doc/plugin/g3--alone-redis.gif">加载动态演示图</button>
|
||||
|
||||
|
||||
要将Sa-Token的数据单独抽离出来很简单,你只需要为Sa-Token单独配置一个Redis连接信息即可
|
||||
@@ -154,7 +154,7 @@ public class TestController {
|
||||
|
||||
分别访问两个接口,观察Redis中增加的数据
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/alone-redis.png" alt="alone-redis" />
|
||||
|
||||
测试完毕!
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ API Key(应用程序编程接口密钥) 是一种用于身份验证和授权
|
||||
|
||||
示例仓库地址:[sa-token-demo-apikey](https://gitee.com/dromara/sa-token/tree/master/sa-token-demo/sa-token-demo-apikey) 🔗
|
||||
|
||||

|
||||
<img class="s-w-sh" src="/big-file/doc/plugin/sa-api-key.png" alt="sa-api-key" />
|
||||
|
||||
|
||||
### 1、需求场景
|
||||
|
||||
@@ -34,7 +34,7 @@ public void rewriteComponent() {
|
||||
|
||||
效果图:
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-custom-serializer-tiangan.png" alt="sa-custom-serializer-tiangan.png" />
|
||||
|
||||
|
||||
#### 2、SaSerializerForBase64UsePeriodicTable
|
||||
@@ -50,7 +50,7 @@ public void rewriteComponent() {
|
||||
|
||||
效果图:
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-custom-serializer-yszqb.png" alt="sa-custom-serializer-yszqb.png" />
|
||||
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public void rewriteComponent() {
|
||||
|
||||
效果图:
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-custom-serializer-tsfh.png" alt="sa-custom-serializer-tsfh.png" />
|
||||
|
||||
|
||||
#### 4、SaSerializerForBase64UseEmoji
|
||||
@@ -83,9 +83,9 @@ public void rewriteComponent() {
|
||||
|
||||
效果图:
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-custom-serializer-emoji.png" alt="sa-custom-serializer-emoji.png" />
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-custom-serializer-emoji2.png" alt="sa-custom-serializer-emoji2.png" />
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -108,11 +108,11 @@ public class TestController {
|
||||
### 测试访问
|
||||
启动项目,使用浏览器访问:`http://localhost:8081`,首次访问时,由于处于未登录状态,会被强制进入登录页面
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-quick-login.png" alt="登录" />
|
||||
|
||||
使用默认账号:`sa / 123456`进行登录,会看到资源页面
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-quick-login-index.png" alt="登录" />
|
||||
|
||||
也可以通过 Http Basic 的方式直接进行认证 (一般需要在专门的 API 测试工具下才能正常测试,浏览器会自动忽略@之前的信息)
|
||||
|
||||
@@ -222,7 +222,7 @@ java -jar sa-quick-dist.jar
|
||||
|
||||
5、测试访问,根据控制台输出提示,我们使用浏览器访问测试: `http://localhost:8080`
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-quick-start.png" alt="sa-quick-start" />
|
||||
|
||||
如果可以进入登录界面,则代表打包运行成功 <br>
|
||||
当然仅仅运行成功还不够,下面我们演示一下如何使用这个jar包进行静态网站部署
|
||||
@@ -272,7 +272,7 @@ SpringBoot默认开放了一些路径作为资源目录,比如`classpath:/stat
|
||||
|
||||
同时,我们还可以在jar包同目录创建yml配置文件,来覆盖jar包内的yml配置,如下图所示:
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-quick-case.png" alt="sa-quick-case.png" />
|
||||
|
||||
例如如上目录中`/static`中有一个`1.jpg`文件,我们启动jar包后访问`http://localhost:8080/1.jpg`即可查看到此文件,这是Springboot自带的功能,在此不再赘述
|
||||
|
||||
|
||||
@@ -132,14 +132,14 @@ public SaResult test11() {
|
||||
|
||||
如果在书写 SpEL 表达式时需要代码提示:
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-check-el-code-tips.png" alt="sa-check-el-code-tips.png" />
|
||||
|
||||
可以在 idea 中安装 **SpEL Assistant** 插件,该插件由 `@ly-chn` 提供,允许为自定义注解书写 SpEL 表达式时增加代码提示功能,
|
||||
开源地址:[https://github.com/ly-chn/SpEL-Assistant](https://github.com/ly-chn/SpEL-Assistant)
|
||||
|
||||
安装方式:直接在 idea 插件商店中搜索 “**SpEL Assistant**” 即可
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/sa-check-el-setup-plugin.png" alt="sa-check-el-code-tips.png" />
|
||||
|
||||
|
||||
<a class="case-btn" href="https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-case/src/main/java/com/pj/cases/more/SaCheckELController.java"
|
||||
|
||||
@@ -134,7 +134,7 @@ public class SaTokenConfigure{
|
||||
|
||||
如果想在写标签属性时增加代码提示:
|
||||
|
||||

|
||||
<img class="s-w" src="/big-file/doc/plugin/thymeleaf-code-tips.png" alt="thymeleaf-code-tips.png" />
|
||||
|
||||
只需在头部声明增加上对应的命名空间即可:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user