mirror of
https://gitee.com/dromara/sa-token.git
synced 2026-02-27 16:50:24 +08:00
Compare commits
17 Commits
7c4865d0e1
...
96cb8c5ad3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96cb8c5ad3 | ||
|
|
a552e84488 | ||
|
|
82158d1ee1 | ||
|
|
26c4957020 | ||
|
|
49ac796460 | ||
|
|
9f8a2b29ba | ||
|
|
e608272f3f | ||
|
|
8be310be15 | ||
|
|
9090eddd8d | ||
|
|
34c0775fa2 | ||
|
|
4c737cb342 | ||
|
|
2294d89db6 | ||
|
|
9444520ad3 | ||
|
|
d0135299d1 | ||
|
|
dce14ce384 | ||
|
|
150781e94f | ||
|
|
192a66aed2 |
16
README.md
16
README.md
@@ -2,11 +2,11 @@
|
||||
<img alt="logo" src="https://sa-token.cc/logo.png" width="150" height="150">
|
||||
</p>
|
||||
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Sa-Token v1.44.0</h1>
|
||||
<h4 align="center">开源、免费、轻量级 Java 权限认证框架,让鉴权变得简单、优雅!</h4>
|
||||
<h4 align="center">开源、免费、一站式 java 权限认证框架,让鉴权变得简单、优雅! </h4>
|
||||
<p align="center">
|
||||
<a href="https://gitee.com/dromara/sa-token/stargazers"><img src="https://gitee.com/dromara/sa-token/badge/star.svg?theme=gvp"></a>
|
||||
<a href="https://gitee.com/dromara/sa-token/members"><img src="https://gitee.com/dromara/sa-token/badge/fork.svg?theme=gvp"></a>
|
||||
<a href="https://gitcode.com/dromara/sa-token/stargazers"><img src="https://gitcode.com/dromara/Sa-Token/star/badge.svg"></a>
|
||||
<a href="https://atomgit.com/dromara/sa-token/stargazers"><img src="https://atomgit.com/dromara/Sa-Token/star/badge.svg"></a>
|
||||
<a href="https://github.com/dromara/sa-token/stargazers"><img src="https://img.shields.io/github/stars/dromara/sa-token?style=flat-square&logo=GitHub"></a>
|
||||
<a href="https://github.com/dromara/sa-token/network/members"><img src="https://img.shields.io/github/forks/dromara/sa-token?style=flat-square&logo=GitHub"></a>
|
||||
<!-- <a href="https://github.com/dromara/sa-token/watchers"><img src="https://img.shields.io/github/watchers/dromara/sa-token?style=flat-square&logo=GitHub"></a> -->
|
||||
@@ -152,9 +152,9 @@ Sa-Token SSO 分为三种模式,可解决:`同域、跨域、共享Redis、
|
||||
|
||||
| 系统架构 | 采用模式 | 简介 | 文档链接 |
|
||||
| :-------- | :-------- | :-------- | :-------- |
|
||||
| 前端同域 + 后端同 Redis | 模式一 | 共享Cookie同步会话 | [文档](https://sa-token.cc/doc.html#/sso/sso-type1)、[示例](https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-sso1-client) |
|
||||
| 前端不同域 + 后端同 Redis | 模式二 | URL重定向传播会话 | [文档](https://sa-token.cc/doc.html#/sso/sso-type2)、[示例](https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-sso2-client) |
|
||||
| 前端不同域 + 后端 不同Redis | 模式三 | Http请求获取会话 | [文档](https://sa-token.cc/doc.html#/sso/sso-type3)、[示例](https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-sso3-client) |
|
||||
| 前端同域 + 后端同 Redis | 模式一 | 共享Cookie同步会话 | [文档](https://sa-token.cc/doc.html#/sso/sso-type1)、[示例](https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-sso/sa-token-demo-sso1-client) |
|
||||
| 前端不同域 + 后端同 Redis | 模式二 | URL重定向传播会话 | [文档](https://sa-token.cc/doc.html#/sso/sso-type2)、[示例](https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-sso/sa-token-demo-sso2-client) |
|
||||
| 前端不同域 + 后端 不同Redis | 模式三 | Http请求获取会话 | [文档](https://sa-token.cc/doc.html#/sso/sso-type3)、[示例](https://gitee.com/dromara/sa-token/blob/master/sa-token-demo/sa-token-demo-sso/sa-token-demo-sso3-client) |
|
||||
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ Sa-Token OAuth2 模块分为四种授权模式,解决不同场景下的授权
|
||||
|
||||
**4、Sa-Token 有哪些权威认证?**
|
||||
|
||||
曾获荣誉包括但不限于:Gitee GVP 最有价值开源项目、GitCode G-Star 优质开源项目、OSCHINA 2021 人气指数 TOP 30 开源项目、OSCHINA 2022 年度最火热中国开源项目社区之一、开放原子基金会2023快速成长开源项目、 Dromara 组织顶尖项目(之一)、可信开源社区共同体预备成员、所在开源社区 “Dromara” 荣获《2024中国互联网发展创新与投资大赛(开源)》二等奖。 Gitee High Star 计划项目(5000+star)。
|
||||
曾获荣誉包括但不限于:Gitee GVP 最有价值开源项目、GitCode G-Star 优质开源项目、OSCHINA 2021 人气指数 TOP 30 开源项目、OSCHINA 2022 年度最火热中国开源项目社区之一、开放原子基金会2023快速成长开源项目、 Dromara 组织顶尖项目(之一)、可信开源社区共同体预备成员、所在开源社区 “Dromara” 荣获《2024中国互联网发展创新与投资大赛(开源)》二等奖。 Gitee High Star 计划项目(5000+star)。Gitee 2025年度开源项目 Web应用开发 Top 2。
|
||||
|
||||
|
||||
**5、Sa-Token 收费吗?**
|
||||
@@ -248,14 +248,14 @@ Sa-Token 采用 Apache-2.0 开源协议,承诺框架本身与在线文档永
|
||||
### 📦 代码托管
|
||||
- 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)
|
||||
- GitCode:[https://gitcode.com/dromara/sa-token](https://gitcode.com/dromara/sa-token)
|
||||
- AtomGit:[https://atomgit.com/dromara/sa-token](https://atomgit.com/dromara/sa-token)
|
||||
|
||||
|
||||
|
||||
### 💬 交流群
|
||||
<!-- QQ交流群:685792424 [点击加入](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=Y05Ld4125W92YSwZ0gA8e3RhG9Q4Vsfx&authKey=IomXuIuhP9g8G7l%2ByfkrRsS7i%2Fna0lIBpkTXxx%2BQEaz0NNEyJq00kgeiC4dUyNLS&noverify=0&group_code=685792424)-->
|
||||
|
||||
QQ交流群:823181187 [点击加入](https://qm.qq.com/q/EBIJVZBVGE)
|
||||
QQ交流群:1081649142 [点击加入](https://qm.qq.com/q/SCAaZ6Ros2)
|
||||
|
||||
微信交流群:
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<img alt="logo" src="https://sa-token.cc/logo.png" width="150" height="150">
|
||||
</p>
|
||||
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Sa-Token v1.44.0</h1>
|
||||
<h5 align="center">开源、免费、轻量级 Java 权限认证框架,让鉴权变得简单、优雅!</h5>
|
||||
<h5 align="center">开源、免费、一站式 java 权限认证框架,让鉴权变得简单、优雅!</h5>
|
||||
<p align="center" class="badge-box">
|
||||
<a href="https://gitee.com/dromara/sa-token/stargazers"><img src="https://gitee.com/dromara/sa-token/badge/star.svg?theme=gvp"></a>
|
||||
<a href="https://gitee.com/dromara/sa-token/members"><img src="https://gitee.com/dromara/sa-token/badge/fork.svg?theme=gvp"></a>
|
||||
<a href="https://gitcode.com/dromara/sa-token/stargazers"><img src="https://gitcode.com/dromara/Sa-Token/star/badge.svg"></a>
|
||||
<a href="https://atomgit.com/dromara/sa-token/stargazers"><img src="https://atomgit.com/dromara/Sa-Token/star/badge.svg"></a>
|
||||
<a href="https://github.com/dromara/sa-token/stargazers"><img src="https://img.shields.io/github/stars/dromara/sa-token?style=flat-square&logo=GitHub"></a>
|
||||
<a href="https://github.com/dromara/sa-token/network/members"><img src="https://img.shields.io/github/forks/dromara/sa-token?style=flat-square&logo=GitHub"></a>
|
||||
<!-- <a href="https://github.com/dromara/sa-token/watchers"><img src="https://img.shields.io/github/watchers/dromara/sa-token?style=flat-square&logo=GitHub"></a> -->
|
||||
@@ -157,7 +157,7 @@ Sa-Token 目前主要五大功能模块:登录认证、权限认证、单点
|
||||
|
||||
**4、Sa-Token 有哪些权威认证?**
|
||||
|
||||
曾获荣誉包括但不限于:Gitee GVP 最有价值开源项目、GitCode G-Star 优质开源项目、OSCHINA 2021 人气指数 TOP 30 开源项目、OSCHINA 2022 年度最火热中国开源项目社区之一、开放原子基金会2023快速成长开源项目、 Dromara 组织顶尖项目(之一)、可信开源社区共同体预备成员、所在开源社区 “Dromara” 荣获《2024中国互联网发展创新与投资大赛(开源)》二等奖。 Gitee High Star 计划项目(5000+star)。
|
||||
曾获荣誉包括但不限于:Gitee GVP 最有价值开源项目、GitCode G-Star 优质开源项目、OSCHINA 2021 人气指数 TOP 30 开源项目、OSCHINA 2022 年度最火热中国开源项目社区之一、开放原子基金会2023快速成长开源项目、 Dromara 组织顶尖项目(之一)、可信开源社区共同体预备成员、所在开源社区 “Dromara” 荣获《2024中国互联网发展创新与投资大赛(开源)》二等奖。 Gitee High Star 计划项目(5000+star)。Gitee 2025年度开源项目 Web应用开发 Top 2。
|
||||
|
||||
|
||||
**5、Sa-Token 收费吗?**
|
||||
@@ -175,6 +175,7 @@ Sa-Token 采用 Apache-2.0 开源协议,承诺框架本身与在线文档永
|
||||
|
||||
如果 Sa-Token 帮助到了您,希望您可以为其点上一个 `star`:
|
||||
[码云](https://gitee.com/dromara/sa-token)、
|
||||
[AtomGit](https://atomgit.com/dromara/sa-token)、
|
||||
[GitHub](https://github.com/dromara/sa-token)
|
||||
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
- [框架博客](/more/blog)
|
||||
- [推荐公众号](/more/tj-gzh)
|
||||
- [加入讨论群](/more/join-group)
|
||||
- [Sa-Token 内容合作群](/more/content-cooperation)
|
||||
- [赞助 Sa-Token](/more/sa-token-donate)
|
||||
- [需求提交](/more/demand-commit)
|
||||
- [问卷调查](/more/wenjuan)
|
||||
|
||||
@@ -124,16 +124,17 @@
|
||||
<a href="https://www.bilibili.com/video/BV11u4y197JL/" target="_blank">达达-Java(26集)</a>
|
||||
<a href="https://space.bilibili.com/473679148/video" target="_blank">晒太阳的盐(22集)</a>
|
||||
<div class="zk-fengexian"></div>
|
||||
<a href="javascript: layer.alert('如您有 Sa-Token 相关课程录制,请联系官网文档右侧 < sa-token 小助手 > 进行提交');">
|
||||
<a href="doc.html#/more/content-cooperation">[ + 课程提交 ]</a>
|
||||
<!-- <a href="javascript: layer.alert('如您有 Sa-Token 相关课程录制,请联系官网文档右侧 < sa-token 小助手 > 进行提交');">
|
||||
[ + 课程提交 ]
|
||||
</a>
|
||||
</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="p-none wzi" href="#/more/link">案例</a>
|
||||
<a class="p-none wzi" href="#/more/join-group">加入讨论群</a>
|
||||
<a class="p-none wzi" href="#/more/demand-commit">需求提交</a>
|
||||
<!-- <a class="p-none wzi" href="#/more/blog">博客</a> -->
|
||||
<a class="p-none wzi" href="#/more/blog">博客</a>
|
||||
<a class="p-none wzi" href="#/more/sa-token-donate">赞助</a>
|
||||
<a class="p-none wzi" href="#/pro/st_doc_top">🔥 SSO/OAuth2 商业版</a>
|
||||
<div class="zk-box">
|
||||
@@ -258,7 +259,8 @@
|
||||
<script src="./static/is-star-plugin.js?v=7"></script>
|
||||
<!-- <script src="./static/is-fill-in-wj-plugin.js?v=7"></script> -->
|
||||
<link rel="stylesheet" href="./static/custom-docsify-plugins/doc-lock-plugin.css">
|
||||
<script src="./static/custom-docsify-plugins/doc-lock-plugin.js"></script>
|
||||
<!-- <script src="./static/custom-docsify-plugins/doc-lock-plugin.js"></script> -->
|
||||
<script src="./static/custom-docsify-plugins/doc-lock-by-gzh-plugin.js"></script>
|
||||
<script>
|
||||
var saTokenTopVersion = '1.44.0'; // Sa-Token最新版本
|
||||
var name = '<img style="width: 60px; height: 60px; vertical-align: middle;" src="logo.png" alt="logo" /> ';
|
||||
@@ -320,7 +322,7 @@
|
||||
myDocsifyPlugin, // 基础插件
|
||||
// window.isStarPlugin, // 是否 star
|
||||
// window.isFillInWjPlugin // 问卷填写
|
||||
window.docLockPlugin // 问卷填写
|
||||
window.docLockPlugin, // 章节锁
|
||||
],
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
---
|
||||
|
||||
QQ群库经常有小伙伴提问:项目需要搭建统一认证中心,是用 SSO 方便还是 OAuth2.0 方便呢?针对这个问题,我们列出两者的主要区别以供大家参考:
|
||||
QQ群里经常有小伙伴提问:项目需要搭建统一认证中心,是用 SSO 方便还是 OAuth2.0 方便呢?针对这个问题,我们列出两者的主要区别以供大家参考:
|
||||
|
||||
|
||||
| 功能点 | SSO单点登录 | OAuth2.0 |
|
||||
|
||||
@@ -71,16 +71,17 @@
|
||||
<a href="https://www.bilibili.com/video/BV11u4y197JL/" target="_blank">达达-Java(26集)</a>
|
||||
<a href="https://space.bilibili.com/473679148/video" target="_blank">晒太阳的盐(22集)</a>
|
||||
<div class="zk-fengexian"></div>
|
||||
<a href="javascript: layer.alert('如您有 Sa-Token 相关课程录制,请联系官网文档右侧 < sa-token 小助手 > 进行提交');">
|
||||
<a href="doc.html#/more/content-cooperation">[ + 课程提交 ]</a>
|
||||
<!-- <a href="javascript: layer.alert('如您有 Sa-Token 相关课程录制,请联系官网文档右侧 < sa-token 小助手 > 进行提交');">
|
||||
[ + 课程提交 ]
|
||||
</a>
|
||||
</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="p-none wzi" href="doc.html#/more/link">案例</a>
|
||||
<a class="p-none wzi" href="doc.html#/more/join-group">加入讨论群</a>
|
||||
<a class="p-none wzi" href="doc.html#/more/demand-commit">需求提交</a>
|
||||
<!-- <a class="p-none wzi" href="doc.html#/more/blog">博客</a> -->
|
||||
<a class="p-none wzi" href="doc.html#/more/blog">博客</a>
|
||||
<a class="p-none wzi" href="doc.html#/more/sa-token-donate">赞助</a>
|
||||
<a class="p-none wzi" href="doc.html#/pro/st_index_top">🔥 SSO/OAuth2 商业版</a>
|
||||
<div class="zk-box">
|
||||
@@ -126,7 +127,7 @@
|
||||
<!-- <div class="fenge"></div> -->
|
||||
<h1>Sa-Token<small>v1.44.0</small></h1>
|
||||
<div class="sub-title">
|
||||
<span class="sub-title-nr">开源、免费、轻量级 java 权限认证框架,让鉴权变得简单、优雅!</span>
|
||||
<span class="sub-title-nr">开源、免费、一站式 java 权限认证框架,让鉴权变得简单、优雅!</span>
|
||||
<div class="gb-cursor"> </div>
|
||||
</div>
|
||||
<div class="btn-box">
|
||||
@@ -143,8 +144,8 @@
|
||||
data-original="https://gitee.com/dromara/sa-token/badge/star.svg?theme=gvp"></a>
|
||||
<a href="https://gitee.com/dromara/sa-token/members"><img class="lazy"
|
||||
data-original="https://gitee.com/dromara/sa-token/badge/fork.svg?theme=gvp"></a>
|
||||
<a href="https://gitcode.com/dromara/sa-token/stargazers"><img class="lazy"
|
||||
data-original="https://gitcode.com/dromara/Sa-Token/star/badge.svg"></a>
|
||||
<a href="https://atomgit.com/dromara/sa-token/stargazers"><img class="lazy"
|
||||
data-original="https://atomgit.com/dromara/Sa-Token/star/badge.svg"></a>
|
||||
<a href="https://github.com/dromara/sa-token/stargazers"><img class="lazy"
|
||||
data-original="https://img.shields.io/github/stars/dromara/sa-token?style=flat-square&logo=GitHub"></a>
|
||||
<a href="https://github.com/dromara/sa-token/network/members"><img class="lazy"
|
||||
@@ -160,8 +161,8 @@
|
||||
<a href="https://gitee.com/dromara/sa-token" target="_blank">
|
||||
<img src="/big-file/index/platform/gitee.png" alt="">
|
||||
</a>
|
||||
<a href="https://gitcode.com/dromara/sa-token" target="_blank">
|
||||
<img src="/big-file/index/platform/gitcode.png" alt="">
|
||||
<a href="https://atomgit.com/dromara/sa-token" target="_blank">
|
||||
<img src="/big-file/index/platform/atomgit.svg" alt="">
|
||||
</a>
|
||||
<a href="https://github.com/dromara/sa-token" target="_blank">
|
||||
<img src="/big-file/index/platform/github.png" alt="">
|
||||
@@ -279,7 +280,7 @@
|
||||
<div class="swiper mySwiper">
|
||||
<div class="swiper-wrapper">
|
||||
<div class="swiper-slide">
|
||||
<img src="/big-file/index/awards-zip/gpv.jpg" /> <br>
|
||||
<img src="/big-file/index/awards-zip/gvp.jpg" /> <br>
|
||||
<p>GVP - Gitee 最有价值开源项目</p>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
@@ -302,6 +303,10 @@
|
||||
<img src="/big-file/index/awards-zip/gitee-star-5000.jpg" /> <br>
|
||||
<p>Gitee 5000 star 专属奖杯</p>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<img src="/big-file/index/awards-zip/gitee-2025.jpg" /> <br>
|
||||
<p>Gitee 2025年度开源项目 Web应用开发 Top 2</p>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<img src="/big-file/index/awards-zip/dromara.jpg" /> <br>
|
||||
<p>Dromara 组织顶尖项目(之一)</p>
|
||||
@@ -693,7 +698,7 @@
|
||||
</a>
|
||||
<a href="https://sa-token.cc/" target="_blank">
|
||||
<img class="lazy" data-original="/big-file/index/dromara/sa-token.png"
|
||||
msg="一个轻量级 java 权限认证框架,让鉴权变得简单、优雅!">
|
||||
msg="一个轻量级 java 权限认证框架,让你的鉴权变得简单、优雅!">
|
||||
</a>
|
||||
<a href="https://gitee.com/dromara/hmily" target="_blank">
|
||||
<img class="lazy" data-original="/big-file/index/dromara/hmily.png"
|
||||
@@ -1087,28 +1092,36 @@
|
||||
<div class="ss-box">
|
||||
<h3>特别鸣谢</h3>
|
||||
<ul class="list-unstyle">
|
||||
<li><a href="https://dromara.org/zh/projects/" target="_blank">Dromara社区</a></li>
|
||||
<li><a href="https://gitee.com/Apache-ShenYu/incubator-shenyu" target="_blank">ShenYu 网关</a>
|
||||
</li>
|
||||
<li><a href="https://gitee.com/dromara/TLog" target="_blank">TLog 分布式日志</a></li>
|
||||
<!-- <li><a href="https://dromara.org/zh/projects/" target="_blank">Dromara社区</a></li> -->
|
||||
<li><a href="https://gitee.com/dromara/liteFlow" target="_blank">LiteFlow 规则引擎</a></li>
|
||||
<li><a href="https://gitee.com/dromara/forest" target="_blank">Forest 工具</a></li>
|
||||
<li><a href="https://gitee.com/Apache-ShenYu/incubator-shenyu" target="_blank">ShenYu 网关</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ss-box">
|
||||
<h3>友情链接</h3>
|
||||
<h3>技术干货</h3>
|
||||
<ul class="list-unstyle">
|
||||
<li><a href="https://www.aliyun.com/" target="_blank">阿里云</a></li>
|
||||
<li><a href="https://cloud.tencent.com/" target="_blank">腾讯云</a></li>
|
||||
<li><a href="https://juejin.cn/" target="_blank">掘金 · 技术社区</a></li>
|
||||
<li><a href="https://juejin.cn/user/3702810894945422" target="_blank">稀土掘金</a></li>
|
||||
<li><a href="https://blog.csdn.net/shengzhang_" target="_blank">CSDN</a></li>
|
||||
<li><a href="https://my.oschina.net/u/3503445" target="_blank">OSCHINA</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ss-box">
|
||||
<h3>关注我们</h3>
|
||||
<ul class="list-unstyle">
|
||||
<li><a href="https://space.bilibili.com/3546758575557094" target="_blank">哔哩哔哩</a></li>
|
||||
<li><a href="https://www.douyin.com/user/MS4wLjABAAAArVqj2lGRurfj-9eO0T12q6_vrbIK-Om9bi3eo4OwB2g" target="_blank">抖音</a></li>
|
||||
<li><a href="https://www.xiaohongshu.com/user/profile/67063b01000000001e00ef23" target="_blank">小红书</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- <div class="ss-box">
|
||||
<h3>联系我们</h3>
|
||||
<ul class="list-unstyle">
|
||||
<li>QQ群 :<a href="doc.html#/more/join-group">点击加入</a></li>
|
||||
<li>邮箱:<a href="javascript: alert('暂无');">暂无</a></li>
|
||||
<li>联系:<a href="javascript: alert('暂无');">暂无</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="ss-box">
|
||||
<h3 class="last" style="text-align: left; float: none; padding-left: 0px;">Sa-Token 公众号</h3>
|
||||
<div class="media-img padding-small-top" style="text-align: left;">
|
||||
@@ -1127,7 +1140,7 @@
|
||||
</style>
|
||||
<div class="foot-box" id="foot">
|
||||
<div class="s-width" style="text-align: center;">
|
||||
Copyright ©2024 Sa-Token java权限认证 | sa-token.cc | <a href="https://beian.miit.gov.cn/"
|
||||
Copyright ©2025 Sa-Token java 权限认证 | sa-token.cc | <a href="https://beian.miit.gov.cn/"
|
||||
target="_blank">鲁ICP备18046274号-4</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1310,7 +1323,7 @@
|
||||
|
||||
<script>
|
||||
// 逐字打印效果
|
||||
var tcStr = '开源、免费、轻量级 java 权限认证框架,让鉴权变得简单、优雅!';
|
||||
var tcStr = '开源、免费、一站式 java 权限认证框架,让鉴权变得简单、优雅!';
|
||||
var con = $('.sub-title .sub-title-nr');
|
||||
var index = 1;
|
||||
var length = tcStr.length;
|
||||
|
||||
@@ -1,14 +1,100 @@
|
||||
# 框架博客
|
||||
|
||||
> 此页面收集 Sa-Token 相关技术文章,欢迎大家投稿(不限平台,按照发表日期倒序),
|
||||
> [投稿链接](https://wj.qq.com/s2/10596458/aa96/)
|
||||
> 此页面收集 Sa-Token 相关技术文章(不限平台,按照发表日期倒序),
|
||||
> 如果你也想投稿,请考虑加入:[Sa-Token 内容合作群 ](/more/content-cooperation)
|
||||
|
||||
---
|
||||
|
||||
- [[ 公众号 ] Sa-Token实战:SpringBoot与微服务权限认证极简方案](https://mp.weixin.qq.com/s/yNma6FhHvPLNHUqYFkdPCg) (2026-1-25)
|
||||
|
||||
- [[ 公众号 ] Sa-Token过期机制](https://mp.weixin.qq.com/s/gFQ8YJT1yg5pTm8Z3uDZHw) (2026-1-22)
|
||||
|
||||
- [[ 公众号 ] 别再写死权限了!SpringBoot + Sa-Token 实现 RBAC 的最佳姿势](https://mp.weixin.qq.com/s/ZwzAInOoqiQ2h0ogWaOoQg) (2026-1-14)
|
||||
|
||||
- [[ 公众号 ] 集成sa-token跨域正确姿势](https://mp.weixin.qq.com/s/tbqjCKrTMj-l1lZbeyu81g) (2026-1-9)
|
||||
|
||||
- [[ 公众号 ] 后端开发必看:最简单的 Java 登录认证框架 Sa-Token 上手指南](https://mp.weixin.qq.com/s/Kk9HEVAG43-FPikiMZKWJw) (2026-1-8)
|
||||
|
||||
- [[ 公众号 ] Sa-Token:一站式权限认证解决方案的实战指南](https://mp.weixin.qq.com/s/FVkn-3CqWT8dNM6a5kD2oA) (2025-12-30)
|
||||
|
||||
- [[ 公众号 ] SpringSecurity、Shiro和Sa-Token,哪个更好?](https://mp.weixin.qq.com/s/gtQ7_n9cPJd2-i_Qm-jk1A) (2025-12-28)
|
||||
|
||||
- [[ 公众号 ] SpringBoot + JWT + Sa-Token:认证鉴权双框架对比,安全登录与权限控制最佳实践](https://mp.weixin.qq.com/s/SDPKdmxtwb4MbOHfg-bF8Q) (2025-12-27)
|
||||
|
||||
- [[ 公众号 ] 一行代码搞定认证](https://mp.weixin.qq.com/s/UaAw1WdVtumA44SxjFW3yg) (2025-12-24)
|
||||
|
||||
- [[ 公众号 ] 《第27节》SpringBoot+SaToken实现鉴权功能](https://mp.weixin.qq.com/s/mY_jrQL1dG2yis51rX2i9w) (2025-12-16)
|
||||
|
||||
- [[ 公众号 ] 告别 Spring Security!Sa-Token + Gateway + Nacos 极简鉴权实战](https://mp.weixin.qq.com/s/s36bdkhi5ACGN2j7hLiD7w) (2025-12-15)
|
||||
|
||||
- [[ 公众号 ] 《第26节》SpringBoot3+SaToken实现用户注册登录功能](https://mp.weixin.qq.com/s/u7nVa0PJcFWx-9xKq1RNhA) (2025-12-13)
|
||||
|
||||
- [[ 公众号 ] 《第25节》SpringBoot3之集成sa-token权限认证框架](https://mp.weixin.qq.com/s/sxgzLqiKCf4_fqWAxN8Ozg) (2025-12-12)
|
||||
|
||||
- [[ 公众号 ] Sa-Token 1.44.0:Java权限认证的“轻量级王者”,让鉴权优雅如诗](https://mp.weixin.qq.com/s/UprusTkp9LZOH9TJDTKJRw) (2025-11-20)
|
||||
|
||||
- [[ 公众号 ] sa-token-rust 项目:高性能的 Rust 认证授权框架](https://mp.weixin.qq.com/s/jlQAX1K1M64DtUgrHrDX1A) (2025-11-17)
|
||||
|
||||
- [[ 公众号 ] 不会吧,居然还有人没有用过?全网爆火的权限校验框架 Sa-Token 超详细教程它来了](https://mp.weixin.qq.com/s/kNYq0MmlYB_0tRWI-HvU1g) (2025-11-6)
|
||||
|
||||
- [[ 公众号 ] 若依框架集成 Sa-Token 实现权限认证与会话管理](https://mp.weixin.qq.com/s/JAgL0hxcPeP0E4OW4oy8Yg) (2025-10-21)
|
||||
|
||||
- [[ 公众号 ] 太强了!Sa-Token 的 Go 版本!](https://mp.weixin.qq.com/s/idfrMeAMY2CeGAZGY9csmw) (2025-10-20)
|
||||
|
||||
- [[ 公众号 ] 太强了!Sa-Token 的 rust 版本!](https://mp.weixin.qq.com/s/CveVq368Dz5Xw-a2nT3YDw) (2025-10-12)
|
||||
|
||||
- [[ 公众号 ] 功能最全的Java权限认证框架](https://mp.weixin.qq.com/s/fO5Mm1UIN8oDOwvbq-sQTw) (2025-10-10)
|
||||
|
||||
- [[ 公众号 ] 从 0 到 1!Sa-Token 与 SpringBoot 整合教程,让鉴权优雅到飞起](https://mp.weixin.qq.com/s/PudodYBsIQODdfeweo39fQ) (2025-10-16)
|
||||
|
||||
- [[ 公众号 ] 一篇搞定!SpringBoot 搭建超安全 Sa-Token 登录鉴权系统](https://mp.weixin.qq.com/s/5fbrNS6jMpuViPPO8z_kMw) (2025-10-3)
|
||||
|
||||
- [[ 公众号 ] 《Spring Cloud Gateway 从入门到实战》第4篇:安全与认证 —— 基于 Sa-Token 的网关统一鉴权方案](https://mp.weixin.qq.com/s/qeWQufIDNtGPyJ0b7yF4vQ) (2025-9-29)
|
||||
|
||||
- [[ 公众号 ] SpringBoot整合Sa-Token实现认证与鉴权](https://mp.weixin.qq.com/s/l4OjqdeNpXjMyFCSr3PuWw) (2025-9-25)
|
||||
|
||||
- [[ 公众号 ] Spring Gateway、Sa-Token、Nacos 认证/鉴权方案](https://mp.weixin.qq.com/s/JpXtI75eANwkRAppQZJG9Q) (2025-9-17)
|
||||
|
||||
- [[ 公众号 ] 告别 Spring Security!Sa-Token + Gateway + Nacos 极简鉴权实战](https://mp.weixin.qq.com/s/hlBH1H6vX-KIlQGmeY8bIg) (2025-9-15)
|
||||
|
||||
- [[ 公众号 ] Spring Gateway、Sa-Token、Nacos 认证/鉴权方案,yyds!](https://mp.weixin.qq.com/s/OYsxjEmLfkxH0NqZidb4fA) (2025-9-10)
|
||||
|
||||
- [[ 公众号 ] Ruoyi-vue-plus-5.x第一篇Sa-Token权限认证体系深度解析:1.4 Sa-Token高级特性实现](https://mp.weixin.qq.com/s/0Fex83DyngC-mxIu346X1Q) (2025-8-30)
|
||||
|
||||
- [[ 公众号 ] Ruoyi-vue-plus-5.x第一篇Sa-Token权限认证体系深度解析:1.3 权限控制与注解使用](https://mp.weixin.qq.com/s/f4iVDeIAZ-nixqR6BNtUfg) (2025-8-30)
|
||||
|
||||
- [[ 公众号 ] Ruoyi-vue-plus-5.x第一篇Sa-Token权限认证体系深度解析:1.2 登录认证机制详解](https://mp.weixin.qq.com/s/gu5kT93WjEauut7xoXmuag) (2025-8-29)
|
||||
|
||||
- [[ 公众号 ] Ruoyi-vue-plus-5.x第一篇Sa-Token权限认证体系深度解析:1.1 Sa-Token框架基础](https://mp.weixin.qq.com/s/w8c5fvaap7ipMu2OdXNZng) (2025-8-29)
|
||||
|
||||
- [[ 公众号 ] 告别 Spring Security!Sa-Token + Gateway + Nacos 极简鉴权实战](https://mp.weixin.qq.com/s/5nmEDAsFgEWk-Ymn_pE74w) (2025-8-22)
|
||||
|
||||
- [[ 公众号 ] 搭建基于sa-token 的网关权限管理系统](https://mp.weixin.qq.com/s/LM6g3QaklSHpaVJXUz5Gvg) (2025-7-19)
|
||||
|
||||
- [[ 公众号 ] 别再被 Spring Security 和 Shiro 劝退了!这款国产 Java 权限框架真香!](https://mp.weixin.qq.com/s/2C0WSlM8zpjqQDtgv59Kaw) (2025-7-1)
|
||||
|
||||
- [[ 公众号 ] 一文精通Java集成Sa-Token实现SSO单点登录](https://mp.weixin.qq.com/s/-fex5XFm4wmTmuzZCtUiRw) (2025-5-22)
|
||||
|
||||
- [[ 公众号 ] 47.8k star,一款接私活神器,10分钟搞定企业级鉴权!](https://mp.weixin.qq.com/s/KRz3-h6etPaKOwHN4Xz7qg) (2025-5-15)
|
||||
|
||||
- [[ 公众号 ] Sa-Token:17.5k Star!轻量级Java权限认证框架,登录鉴权超简单](https://mp.weixin.qq.com/s/akPTgU8sQkwWmXm4GNSyyQ) (2025-5-11)
|
||||
|
||||
- [[ 公众号 ] SaToken-微服务认证与授权](https://mp.weixin.qq.com/s/9WYg6iLDST7YDSSsCt1NxQ) (2025-4-3)
|
||||
|
||||
- [[ 公众号 ] SpringBoot 整合 Sa-Token 快速实现 API 接口签名安全校验](https://mp.weixin.qq.com/s/2NS3axN1CbRYULHrv5Du2w) (2025-3-20)
|
||||
|
||||
- [[ 公众号 ] SaToken 简化开发的身份认证与权限管理框架](https://mp.weixin.qq.com/s/Yxsswl4Zn8244j4XeV8_VA) (2025-1-24)
|
||||
|
||||
- [[ 公众号 ] 使用 Sa-Token 平替 Spring Security,告别繁琐的认证与鉴权!](https://mp.weixin.qq.com/s/whKQPm09ApzkVBjlSwO2Tg) (2025-1-15)
|
||||
|
||||
- [[ 公众号 ] sa-token之@SaIgnore注解失效的真正原因及正确姿势](https://mp.weixin.qq.com/s/c6eckHp2M4oz2x3Hea6pGg) (2025-1-14)
|
||||
|
||||
- [[ 公众号 ] SpringBoot3.x+Vue3+Sa-Token实现登录认证](https://mp.weixin.qq.com/s/0GkDoOYW8KKxTfzV83J6UA) (2024-12-27)
|
||||
|
||||
- [[ 公众号 ] 万字雄文:一次说清基于Sa-Token和MaxKey的统一认证中心实现](https://mp.weixin.qq.com/s/Gl2K47F9I6-Il-AieWLplw) (2024-11-15)
|
||||
|
||||
<!-- 2026-2-3 搜集至 2024-11-15 公众号平台 -->
|
||||
|
||||
- [[ 公众号 ] sa-token之@SaIgnore注解失效的真正原因及正确姿势](https://mp.weixin.qq.com/s/c6eckHp2M4oz2x3Hea6pGg) (2025-1-15)
|
||||
|
||||
- [[ 公众号 ] 集成sa-token前后端分离部署配置corsFliter解决跨域失效的真正原因](https://mp.weixin.qq.com/s/bSS4vmKlKM7ov_CUkjxkBg) (2024-07-08)
|
||||
|
||||
|
||||
104
sa-token-doc/more/content-cooperation.md
Normal file
104
sa-token-doc/more/content-cooperation.md
Normal file
@@ -0,0 +1,104 @@
|
||||
# Sa-Token 内容合作群
|
||||
|
||||
**好内容值得被看见!**
|
||||
|
||||
为感谢 Sa-Token 的内容创作者们,我们特别创建了「Sa-Token 内容合作群」,帮助大家的内容触达更多 Sa-Token 的使用者 (加群方式在最下方)。
|
||||
|
||||
---
|
||||
|
||||
|
||||
### 📖 1、一些碎碎念,想和写公众号/录视频的朋友们聊聊
|
||||
|
||||
前几天,我在公众号上搜索 “Sa-Token”,想看看有没有人写过相关的教程或者踩坑心得。
|
||||
|
||||
说实话,当时没抱太大期望。毕竟我们开发团队这几年来几乎将所有精力都放在了代码开发,而一直疏于内容运营建设。
|
||||
|
||||
但结果让我挺意外的 —— **我发现了不少公众号都在写 Sa-Token 的文章,而且其中不少都写得很用心**。
|
||||
|
||||
有从零开始的入门教程,有深入源码的解析文章,有对框架各个功能的介绍,还有一些结合真实业务场景的实战案例 …… 解决的都是实实在在的问题。
|
||||
|
||||
但这些文章的阅读量… 很多都只有几百,有些甚至只有几十。
|
||||
|
||||
我知道这很正常。**技术公众号起步非常不容易,粉丝少的时候,再好的内容也很难被看到**。我自己也经历过这个阶段,知道那种 [ 写了一整天,发出来没人看 ] 的感觉。
|
||||
|
||||
为了不让这些有价值的内容埋没,我连夜将这些文章整理到了 Sa-Token 官网:[框架博客](/more/blog)。
|
||||
|
||||
在整理这些博客的过程中,我突然有了一个想法。
|
||||
|
||||
|
||||
### ✨ 2、一个可能 [三赢] 的想法
|
||||
|
||||
我在想,我为什么不拉一个群聊,把这些为 Sa-Token 写文章的博主们,给聚集起来呢?
|
||||
|
||||
只要有朋友写了 Sa-Token 相关文章,都可以转发到群里,我们团队会把这个文章转发到 Sa-Token 所有粉丝群里:
|
||||
|
||||
这可能是一个三赢的合作:
|
||||
|
||||
- **对于 Sa-Token 来说**:能获得更多的优质内容,帮助新用户更快上手,生态也能更丰富。
|
||||
- **对写文章的朋友来说**:你的好文章能被更多人看到,公众号能涨涨粉,付出的时间更有价值。
|
||||
- **对 Sa-Token 的用户来说**:能看到更多的技术干货,学到更多知识,找到各种场景的解决方案,不用重复踩坑。
|
||||
|
||||
听起来好像…还不错?
|
||||
|
||||
所以我打算建个群,名字就叫 「Sa-Token 内容合作群」。不是什么正式的组织,就是一群对技术内容感兴趣的朋友,凑在一起互相帮帮忙。
|
||||
|
||||
|
||||
### 🤝 3、这个群主要用来做什么?
|
||||
|
||||
1、如果你写了 Sa-Token 相关的文章(或录制了视频课程),可以分享到群里,我们团队会把文章:
|
||||
|
||||
- **转发到 Sa-Token 所有粉丝群里**:Sa-Token 目前拥有 30+ 微信粉丝群 (500人),10+ QQ粉丝群 (1000人 or 2000人)。
|
||||
- **挂载到 Sa-Token 在线文档博客栏目**:Sa-Token 目前在线文档访问量月PV 20万+。
|
||||
|
||||
相信这一定可以大大提高文章的曝光量。
|
||||
|
||||
2、我们团队偶尔也会为 Sa-Token 撰写技术文章,发到群里:
|
||||
|
||||
- 如果你觉得内容不错,想转载到自己的公众号,**直接转就行**。
|
||||
- 不用专门申请授权,Sa-Token 官方订阅号所有内容均开放版权,任何人都可以自由转载。
|
||||
|
||||
|
||||
### ❤️ 4、几个你可能关心的小问题
|
||||
|
||||
#### Q:我没写过 Sa-Token 的文章,可以加入吗?
|
||||
可以。完全没问题。哪怕你之前从来没写过 Sa-Token 的文章,但只要你有公众号,想试试写相关的内容,都欢迎。
|
||||
|
||||
如果你没有公众号,但是在别的平台,比如掘金、CSDN有写过文章,也可以加入。如果你在 B站/抖音录制过视频,也可以加入。
|
||||
|
||||
总之:只要你有意向在任意平台创作 Sa-Token 相关内容,就可以加入。
|
||||
|
||||
|
||||
#### Q:有 KPI 吗?是不是进了群就要为 Sa-Token 写文章?
|
||||
没有。 想写就写,不想写就不写。哪怕加群后一篇都不写,也没关系。**这就是个「互助群」,不是「任务群」**。
|
||||
|
||||
#### Q:文章有什么要求吗?
|
||||
就一点:认真写。
|
||||
可以是入门教程、源码解析、实战心得、bug排查、常见踩坑、对比测评…什么形式都行。不需要多长的篇幅,能把一个知识点讲清楚就好。唯一的要求是:不要是纯 AI 生成的粗制滥造文,不要写明显错误的技术观点。
|
||||
|
||||
#### Q:对粉丝量有要求吗?
|
||||
没有要求。 我自己也是从小号做起来的,完全理解起步的难处。群里不分大号小号,只看内容用不用心。
|
||||
|
||||
#### Q:除了转发,还有别的吗?
|
||||
有。 我偶尔会分享一些 Sa-Token 的更新动态、设计思路,或者我发现的其他好的技术文章。大家也可以互相**聊聊技术写作、视频制作的心得,分享好用的工具**。就是个普通的交流群,只不过主题稍微聚焦一点。
|
||||
|
||||
说到底,我希望这个群不只是一个内容分发渠道,更是一个 「Sa-Token内容共创伙伴」的聚集地。我们一起,让好的技术方案被更多人看见和使用。
|
||||
|
||||
|
||||
### 👋 5、怎么加群?
|
||||
|
||||
你可以在 [加入讨论群](/more/join-group) 处,添加我们的微信账号, **请在添加时备注或者加好友成功后发送以下信息:[申请加入 Sa-Token 内容合作群]** 。
|
||||
|
||||
一定要备注以上信息,否则我们团队人员只会把你拉入到普通粉丝交流群。
|
||||
|
||||
<img class="s-w" src="/big-file/contact/show/wx-sthzq-show.png" style="max-width: 50%;" alt="Sa-Token 生态合作群" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
-->
|
||||
|
||||
<!-- QQ交流群:936523917 [点击加入](https://qm.qq.com/q/xfoMJA5Az0) -->
|
||||
QQ交流群:823181187 [点击加入](https://qm.qq.com/q/EBIJVZBVGE)
|
||||
QQ交流群:1081649142 [点击加入](https://qm.qq.com/q/SCAaZ6Ros2)
|
||||
|
||||
### 2、加入微信交流群:
|
||||
|
||||
@@ -70,5 +70,6 @@ QQ群聊号码:939849926
|
||||
(例如:xx开源项目作者集成了 sa-token,申请加入群聊),如果字数太多无法写完,也可在开源交流群里@管理员协助交流。
|
||||
|
||||
|
||||
|
||||
### 5、Sa-Token 内容合作群
|
||||
专门为 Sa-Token 内容创作者们准备的交流群:[Sa-Token 内容合作群](/more/content-cooperation)
|
||||
|
||||
|
||||
@@ -8,6 +8,22 @@
|
||||
|
||||
### 后台管理
|
||||
|
||||
- [[ art-design-pro-java ]](https://github.com/anganing/art-design-pro-java):SpringBoot17+Sa-token+Art-Design-Pro+Unibest 技术栈的企业级后台开发管理系统。
|
||||
|
||||
- [[ wemirr-platform ]](https://gitee.com/battcn/wemirr-platform):JDK17、SCA2023、SC2024、Sa-Token、VBen5.x 全网最炫酷,功能最多,最优雅地真开源 多租户、SAAS 微服务项目。
|
||||
|
||||
- [[ Lucky-Admin-Vue ]](https://gitee.com/xiaodu6/lucky-admin-vue):一个基于vue-admin-template的后台管理框架,集成了动态角色权限,动态路由,角色权限动态配置,日志框架,代码生成,Sa-Token权限校验,快速构建一个后台的开发框架。
|
||||
|
||||
- [[ 灯灯]](https://github.com/dromara/lamp-cloud):基于java + SpringCloudAlibaba +SpringBoot 开发的微服务中后台快速开发平台,专注于多租户 (SaaS架构) 解决方案,亦可作为普通项目(非SaaS架构)的基础开发框架使用,目前已实现 数据源隔离、字段隔离、无租户隔离 等几种模式。
|
||||
|
||||
- [[ 橙单 ]](https://gitee.com/orangeform/orange-admin):技术栈Boot3 + Flowable7 + Sa-Token + Mybatis-Flex/Mybatis-Plus + Vue3,支持开箱即用且功能完成的工作流和在线表单功能,提供高颜值的流程和表单编辑器全部前后端源码。
|
||||
|
||||
- [[ Sz-Admin ]](https://github.com/feiyuchuixue):一个开源RBAC中后台框架,专为现代应用设计。它结合了最新的技术栈,包括后端的Spring Boot 3、JDK 21、Mybatis Flex、Sa-Token、Knife4j和Flyway,以及前端的Vue 3、Vite5、TypeScript和Element Plus,致力于为您提供一个直观、流畅且功能强大的开发体验。
|
||||
|
||||
- [[ newbie-boot3 ]](https://github.com/zhangyuge7/newbie-boot3):企业级中大型项目快速开发平台,后端使用JDK21+SpringBoot3+SaToken+MybatisPlus等,前端基于FiveAdminV2后台管理系统模板开发,使用js+vue3+vite5+ElementPlus等最新技术栈。
|
||||
|
||||
- [[ EuBackend ]](https://gitee.com/zhaoeryu/eu-backend):EuBackend 是一套全部开源的前后端分离 Java EE 企业级快速开发平台,基于最新技术栈SpringBoot、Sa-Token、MyBatisPlus等作为后端框架,使用RBAC作为权限控制模型,并且毫无保留给个人及企业免费使用。
|
||||
|
||||
- [[ srppms ]](https://gitee.com/cai-bin00/srppms):基于SpringBoot+Vue+sa-token前后端分离的科研项目管理平台。
|
||||
|
||||
- [[ twelvet-fast ]](https://gitee.com/twelvet/twelvet-fast):基于Spring Boot 3 JDK17的单体服务极速开发管理平台脚手架,先行体验最新技术栈。
|
||||
@@ -28,8 +44,6 @@
|
||||
|
||||
- [[ vue-satoken-admin ]](https://gitee.com/niluni/vue-satoken-admin):基于Vue2和Sa-Token1.18.0的后台权限系统。
|
||||
|
||||
- [[ 人事管理系统后端 ]](https://gitee.com/sdones_1512/personnel-management-system-back-end):人事管理系统后端,框架:springboot,持久层:mybatis,缓存:redis,权限:sa-token
|
||||
|
||||
- [[ bootx-platform ]](https://gitee.com/bootx/bootx-platform):包含支付收单(支付宝、微信、聚合、组合支付)、工作流(Flowable)、三方对接(微信、钉钉、企微、短信)等模块,前端基于Vue2和Vue3分别打造,可应用在不同业务场景中,目标是致力实现媲美商业版应用脚手架。
|
||||
|
||||
- [[ spba-admin ]](https://gitee.com/qkdja/spring-boot-admin):基于SpringBoot、Vue开发的通用后台管理系统,做到开箱即用,为新项目开发省去了基础功能开发的步骤。主要使用Sa-Token权限认证、MyBatis-Plus、MySQL、Redis、validation、七牛云等技术。
|
||||
@@ -38,7 +52,7 @@
|
||||
|
||||
- [[ ExciteCMS-Layui ]](https://gitee.com/ExciteTeam/ExciteCMS-SpringBoot-Layui):ExciteCMS 快速开发脚手架:一款后端基于 SpringBoot2 + Sa-Token + Mybatis-Plus,前端基于 Layuimini 的内容管理系统,具备RBAC、日志管理、代码生成等功能,并集成常用的支付、OSS等第三方服务,拥有详细的开发文档
|
||||
|
||||
- [[ sss-rbac-admin ]](https://gitee.com/momoljw/sss-rbac-admin):基于springboot,整合satoken、sqltoy的权限管理系统
|
||||
- [[ sra-admin ]](https://github.com/CoCoTeaNet/sra-admin):快速开发脚手架,核心依赖:springboot3+sqltoy+satoken+hutool | 轻量级 | 只实现了用户、字典、角色、权限等常见功能,能够快速搭建一个web项目。
|
||||
|
||||
- [[ QuickBuild ]](https://gitee.com/CodeLiQing/custom-quick-build-platform): 快速构建 | 基于springboot+sa-token+neety+代码生产器(生成vue页面和增删改查代码)| 以及前端vue3和字节arco.design框架整合
|
||||
|
||||
@@ -58,7 +72,7 @@
|
||||
|
||||
- [[ RuoYi-Vue-CMS ]](https://gitee.com/liweiyi/RuoYi-Vue-CMS):RuoYi-Vue-CMS是前后端分离的内容管理系统,支持站群管理、多平台静态化、元数据模型扩展、多语言、全文检索,能轻松组织各种复杂内容形态。技术栈:SpringBoot3 + VUE2 + MybatisPlus + Sa-Token + xxl-job + Freemarker + ES + Redis + MySQL。
|
||||
|
||||
- [[ springboot-multi-tenant-sa-token ]](https://gitee.com/willf/springboot-multi-tenant-sa-token):轻量的多租户权限管理系统脚手架(SpringBoot,Sa-Token,mybatis-plus,Vue & Element)。
|
||||
- [[ springboot-multi-tenant-sa-token ]](https://gitee.com/willf/springboot-multi-tenant-sa-token):轻量的多租户后台管理系统脚手架(SpringBoot,Sa-Token,mybatis-plus,Vue & Element)。
|
||||
|
||||
- [[ solon_angis_beetlsql ]](https://gitee.com/smartcity/solon_angis_beetlsql):并元国产开发平台 solon、sa-token、beetlsql、smart-http
|
||||
|
||||
@@ -66,9 +80,30 @@
|
||||
|
||||
- [[ nebula-swagger-demo ]](https://gitee.com/flgitee/nebula-swagger-demo):springboot+nebula 集成knife4j案例
|
||||
|
||||
- [[ warm-sun]](https://gitee.com/min290/warm-sun):基于solon+vue3开发,jdk17+satoken+redisx/redisson+mybaits-flex+hutool+jackson+mapstruct+poi
|
||||
|
||||
- [[ContiNew Admin]](https://gitee.com/Charles7c/continew-admin):ContiNew Admin 中后台管理框架/脚手架,Continue New Admin,持续以最新流行技术栈构建,拥抱变化,迭代优化。当前采用的技术栈:Vue3、TypeScript、Arco Design Vue、Spring Boot3(JDK17)、Undertow、Sa-Token、JWT、MariaDB、MyBatis Plus、Redis、Redisson、Easy Excel、Hutool 等。
|
||||
|
||||
- [[laymini-admin]](https://gitee.com/wlf213/laymini-admin):基于layuimini前端框架开发的一个简单的后台管理前后端不分离框架,主体技术mybatisplus+sa_token+springboot+freemarker,主要功能:RABC认证授权,后台管理功能,集成Quartz动态定时任务。
|
||||
|
||||
- [[ Smart-Admin ]](https://gitee.com/lab1024/smart-admin):SmartAdmin国内首个以「高质量代码」为核心,「简洁、高效、安全」中后台快速开发平台;基于SpringBoot + Sa-Token + Mybatis-Plus 和 Vue3 + Vite5 + Ant Design Vue 4.x (同时支持JavaScript和TypeScript双版本);满足国家三级等保要求、支持登录限制、接口数据国产加解密、高防SQL注入等一系列安全体系。
|
||||
|
||||
- [[ Halcyon-Admin ]](https://github.com/hhfb8848/halcyon-springboot):基于 Spring Boot 3 和 Vue 3 的通用后台管理系统,专注于提供基本的管理功能,而非特定的部门管理或业务功能。
|
||||
|
||||
- [ breeze-boot-satoken-xxx系统 ]:breeze-boot-satoken-xxx 是一个开源免费(前后端分离)中后台管理系统基础解决方案,前端技术栈:( Vue3、 TypeScript、Element Plus、Pinia 、Vite)后端技术栈:(jdk17、 springboot3、SaToken、MybatisPlus等)
|
||||
- SSO 版本,后端:https://gitee.com/breeze-boot/breeze-boot-satoken-sso
|
||||
- SSO 版本,前端:https://gitee.com/breeze-boot/breeze-vite-ui-satoken-sso
|
||||
- OAUTH 版本,后端:https://gitee.com/breeze-boot/breeze-boot-satoken-oauth
|
||||
- OAUTH 版本,前端: https://gitee.com/breeze-boot/breeze-vite-ui-satoken-oauth
|
||||
- [[ Summer-Flowers · 夏花 ]](https://gitee.com/Luv404/summer-flowers):基于 **Spring Boot 3 + JPA + QueryDSL + Sa-Token** 的企业级后台开发框架,前端采用 **SoybeanAdmin**。不同于常见 MyBatis 体系,Summer-Flowers 以 **Entity 作为业务第一表达**,通过 QueryDSL 实现类型安全的复杂查询,配合代码生成器与模块化架构,显著降低中长期项目的维护成本。
|
||||
|
||||
|
||||
|
||||
|
||||
### 微服务相关
|
||||
|
||||
- [[ XHan Admin ]](https://gitee.com/sun-xiaohan/xh-admin-frontend):XHan Admin 是一个开源免费(前后端分离)中后台管理系统基础解决方案, 无专业版收费,所有功能毫无保留的贡献给开源社区,使用最新技术栈全新开发,无任何历史代码包袱。
|
||||
|
||||
- [[ RuoYi-Cloud-Plus ]](https://gitee.com/dromara/RuoYi-Cloud-Plus):重写RuoYi-Cloud所有功能 整合 SpringCloudAlibaba + Sa-Token + Dubbo + Mybatis-Plus + Xxl-Job 全方位升级 定期同步
|
||||
|
||||
- [[ Sp-Cloud ]](https://gitee.com/click33/sp-cloud):Sa-Plus的微服务版本, 基于Spring-Cloud-Alibaba,微服务下使用Sa-Token的样例
|
||||
@@ -93,6 +128,10 @@
|
||||
|
||||
- [[ quick-boot ]](https://github.com/csx-bill/quick-boot):一款基于 Spring Cloud 2022 、Spring Boot 3、AMIS 和 APIJSON 的低代码系统。
|
||||
|
||||
- [[ linkin-platform ]](https://gitee.com/paohaizi/linkin-platform):Springboot + Springcloud + nacos + Mybatis Plus + Sa-Token + Vue3 + ElementPlus
|
||||
微服务下使用Sa-Token的样例,是一套比较简洁的后台系统。
|
||||
|
||||
- [[ LangChat ]](https://github.com/TyCoding/langchat):( OpenAI / Gemini / Ollama / Azure / 智谱 / 阿里通义大模型 / 百度千帆大模型), Java生态下AI大模型产品解决方案,快速构建企业级AI知识库、AI机器人应用
|
||||
|
||||
### 商城
|
||||
|
||||
@@ -111,6 +150,10 @@
|
||||
|
||||
- [[ June 12 ]](https://gitee.com/hanshaung/ants):June 12 是一个纯开源免费的资讯/博客类网站,基于Spring Boot + Sa-Token + Vue开发。
|
||||
|
||||
- [[ YuanBlog ]](https://gitee.com/wlf213/yuan-blog):一款代码简单,功能丰富的多人社交博客平台。前后端分离,Vue+SpringBoot3,博客前端使用Quasar,后台管理前端使用NaiveUI,博客后端,后台管理后端分为两个系统,均使用Sa-Token进行认证授权。支持邮箱验证码登录。
|
||||
|
||||
- [[ 鸢尾博客 ]](https://gitee.com/lxwise/iris-blog_parent):鸢尾博客是一个基于Spring Boot+Vue3 + TypeScript + Vite+JavaFx的客户端和服务器端的博客系统。项目采用前端与后端分离,支持移动端自适应,配有完备的前台和后台管理功能。后端使用Sa-Token进行权限管理,支持动态菜单权限,服务健康监控,数据流量统计,支持QQ、微博、码云、GitHub等三方登录。
|
||||
|
||||
|
||||
|
||||
### 插件
|
||||
@@ -120,9 +163,22 @@
|
||||
- [[ quarkus-sa-token ]](https://github.com/quarkiverse/quarkus-sa-token): quarkus 整合 Sa-Token。
|
||||
|
||||
|
||||
### 多语言
|
||||
|
||||
- Rust:[[ sa-token-rust ]](https://github.com/llc-993/sa-token-rust): 一个轻量级、高性能的 Rust 认证授权框架。
|
||||
|
||||
- Go:[[ sa-token-go ]](https://github.com/click33/sa-token-go): 一个轻量级、高性能的 Go 权限认证框架。
|
||||
|
||||
- PHP:[[ real-token ]](https://gitee.com/jinan-jimeng-network_0/real-token): 一个轻量级 thinkphp6 权限认证框架,让鉴权变得简单、优雅!
|
||||
|
||||
|
||||
|
||||
### 其它
|
||||
|
||||
- [[ Glowxq-OJ ]](https://github.com/glowxq/glowxq-oj):Glowxq-OJ 专业开源在线编程测评系统 | 基于Spring Boot 3.x + Java 21 + Vue 3构建 | 支持ACM/ICPC竞赛、信奥赛训练、编程教育 | 多语言判题、实时竞赛、在线IDE | Docker一键部署 | Modern Online Judge Platform for Competitive Programming & Coding Education。
|
||||
|
||||
- [[ FlyFlow ]](https://gitee.com/junyue/flyflow):基于SaToken开发的开源工作流系统:FlyFlow借鉴了钉钉与飞书的界面设计理念,致力于打造一款用户友好、快速上手的工作流程工具。
|
||||
|
||||
- [[ Sa-Token-Study ]](https://gitee.com/sa-tokens/sa-token-study):以demo示例的方式讲解 Sa-Token 源码涉及到的技术点,连载中……
|
||||
|
||||
- [[ SpringMvc+Sa-Token ]](https://gitee.com/SRD_01/spring-mvc-sa-token): Jsp+SpringMVC+SSO+Sa-Token+Redis | Spring MVC 集成 SaToken Demo 项目
|
||||
@@ -130,3 +186,19 @@
|
||||
- [[ iot-kit ]](https://gitee.com/iotkit-open-source/iotkit-parent):一个轻量级低门槛的物联网平台,包含了多协议设备接入、规则引擎、第三方平台接入、智能家居小程序等模块的项目,基于SpringBoot架构并集成了Sa-Token的OAuth2认证。
|
||||
|
||||
- [[ cubic ]](https://gitee.com/dromara/cubic):一站式问题定位平台,实时线程栈监控、线程池监控、动态arthas命令集、依赖分析等等等,助你快速定位问题。
|
||||
|
||||
- [[ ChatGPT-WEB ]](https://github.com/dulaiduwang003/ChatGPT-WEB):基于JDK17+SpringBoot3+UniApp 绘图 聊天 充值应用。(Web版本)
|
||||
|
||||
- [[ SuperBot-ChatGPTApp ]](https://github.com/dulaiduwang003/SuperBot-ChatGPTApp):基于JDK17+SpringBoot3+UniApp 绘图 聊天 充值应用。(小程序版本)
|
||||
|
||||
- [[ ScribbleHub ]](https://github.com/dulaiduwang003/ScribbleHub):基于SpringBoot+satoken+wxss开发的博客小程序
|
||||
|
||||
- [[ TIME-SEA-chatgpt ]](https://github.com/dulaiduwang003/TIME-SEA-chatgpt):基于SpringBoot+satoken+vue3+uniapp开发的多端Ai平台应用
|
||||
|
||||
- [[ SUPERBOT-GPT]](https://github.com/dulaiduwang003/SUPERBOT-GPT):基于SpringBoot3+satoken+uniapp开发的流量主小程序
|
||||
|
||||
- [[ DaxPay ]](https://gitee.com/dromara/dax-pay):一款免费开源的支付网关系统,支持支付宝、微信、云闪付等通道,提供收单、退款、聚合支付、对账、分账等功能。
|
||||
|
||||
- [[ Dinky ]](https://github.com/DataLinkDC/dinky):基于Apache Flink的实时数据开发平台,实现敏捷的数据开发、部署和运维
|
||||
|
||||
- [[ mldong ]](https://gitee.com/mldong/mldong):SpringBoot + Vue3 快速开发平台、自研工作流引擎
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
### 1、如何自定义 OAuth-Server 端的登录视图?
|
||||
|
||||
重写 `cfg.notLoginView` 策略:
|
||||
重写 `SaOAuth2Strategy.instance.notLoginView` 策略:
|
||||
|
||||
``` java
|
||||
@Autowired
|
||||
@@ -60,7 +60,7 @@ public SaResult ss(String name, String pwd) {
|
||||
|
||||
### 3、如何自定义 OAuth-Server 端的确认授权视图?
|
||||
|
||||
重写 `cfg.confirmView` 策略:
|
||||
重写 `SaOAuth2Strategy.instance.confirmView` 策略:
|
||||
|
||||
``` java
|
||||
@Autowired
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## SSO-Client 前后端分离
|
||||
|
||||
要在前后端分离的环境中接入 SSO,思路不难,主要的工作是吧后端 `/sso/login` 接口的路由中转工作拿到前端来,以`sa-token-demo-sso3-client`为例:
|
||||
要在前后端分离的环境中接入 SSO,思路不难,主要的工作是把后端 `/sso/login` 接口的路由中转工作拿到前端来,以`sa-token-demo-sso3-client`为例:
|
||||
|
||||
### 1、在 sso-client 后端新建`H5Controller`,开放接口:
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
|
||||
|
||||
### 问:Client 信息可以做成从数据库读取的吗?
|
||||
可以,自定义 `SaSsoServerTemplate` 实现类,重写 `getClient` 与 `getClient` 方法即可:
|
||||
可以,自定义 `SaSsoServerTemplate` 实现类,重写 `getClient` 与 `getClients` 方法即可:
|
||||
``` java
|
||||
/**
|
||||
* 重写 SaSsoServerTemplate 部分方法,增强功能
|
||||
|
||||
@@ -0,0 +1,521 @@
|
||||
// 章节锁定插件
|
||||
|
||||
// 声明 docsify 插件
|
||||
var docLockPlugin = function(hook, vm) {
|
||||
|
||||
// 钩子函数:解析之前执行
|
||||
hook.beforeEach(function(content) {
|
||||
return content;
|
||||
});
|
||||
|
||||
// 钩子函数:每次路由切换时,解析内容之后执行
|
||||
hook.afterEach(function(html) {
|
||||
return html;
|
||||
});
|
||||
|
||||
// 钩子函数:每次路由切换时数据全部加载完成后调用,没有参数。
|
||||
hook.doneEach(function() {
|
||||
isShowTanChuang(vm);
|
||||
});
|
||||
|
||||
// 钩子函数:初始化并第一次加载完成数据后调用,没有参数。
|
||||
hook.ready(function() {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ======================================== 弹窗方法
|
||||
|
||||
// 检查成功后,多少天不再检查
|
||||
const dl_AllowDisparity = 1000 * 60 * 60 * 24 * 30 * 1; // 1个月
|
||||
// 拦截 path ,如果填 /** 代表所有路径,填 /sso/* 代表 /sso/ 目录下所有路径
|
||||
const dl_exeArray = [
|
||||
'/sso/*', '/oauth2/*', '/more/common-questions', '/up/*', '/micro/*', '/plugin/*'
|
||||
];
|
||||
// 排除 path
|
||||
const dl_excludeArray = [
|
||||
'/sso/readme', '/oauth2/readme'
|
||||
];
|
||||
// 本次存储时,使用的标记 key
|
||||
const dl_saveKey = 'dl_saveKey';
|
||||
|
||||
|
||||
// 判断当前是否应该弹出
|
||||
function isShowTanChuang(vm) {
|
||||
// 非PC端不检查
|
||||
// if(document.body.offsetWidth < 800) {
|
||||
// console.log('small screen ... wj ');
|
||||
// return;
|
||||
// }
|
||||
|
||||
// 判断是否需要拦截
|
||||
const isExe = isExePath(vm.route.path, dl_exeArray, dl_excludeArray);
|
||||
if(!isExe) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 判断是否近期已经判断过了
|
||||
try{
|
||||
const flagTime = localStorage[dl_saveKey];
|
||||
if(flagTime) {
|
||||
// 记录 存储 的时间,和当前时间的差距
|
||||
const disparity = new Date().getTime() - parseInt(flagTime);
|
||||
|
||||
// 差距小于指定时间,不再检测
|
||||
if(disparity < dl_AllowDisparity) {
|
||||
console.log('checked ... docLock ');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}catch(e){
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
// 本次打开页面的内存内已经弹出了的话,也不再弹了
|
||||
// if(window.isYtcXsjfkasjdaaaa) {
|
||||
// return;
|
||||
// }
|
||||
// window.isYtcXsjfkasjdaaaa = true;
|
||||
|
||||
// 验证成功的回调
|
||||
const okFn = function() {
|
||||
console.log('ok 了');
|
||||
localStorage.setItem(dl_saveKey, new Date().getTime() );
|
||||
$('body').css({'overflow': 'auto'});
|
||||
layer.msg('感谢你的支持,Sa-Token 将努力变得更加完善! ❤️ ❤️ ❤️ ');
|
||||
}
|
||||
// 点了返回的回调
|
||||
const backFu = function() {
|
||||
$('body').css({'overflow': 'auto'});
|
||||
location.href = '#/';
|
||||
}
|
||||
// 弹窗验证
|
||||
showDocLock(okFn, backFu);
|
||||
$('body').css({'overflow': 'hidden'});
|
||||
|
||||
// 弹出弹框,邀请填写
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// ======================================== 路径判断
|
||||
|
||||
/**
|
||||
* 判断一个路径,是否会被成功拦截,返回 true 或 false
|
||||
* @param {Object} path 要判断的路径,例如:/sso/apidoc
|
||||
* @param {Object} exeArray 要拦截的路径数组,例如:['/sso/*', '/oauth2/*', '/more/common-questions' ],如果填 /** 代表所有路径,填 /sso/* 代表 /sso/ 目录下所有路径
|
||||
* @param {Object} excludeArray 要排除的路径数组,规则同上
|
||||
*/
|
||||
function isExePath( path, exeArray, excludeArray) {
|
||||
// 参数验证和初始化
|
||||
exeArray = exeArray || [];
|
||||
excludeArray = excludeArray || [];
|
||||
|
||||
// 标准化路径,确保以 / 开头
|
||||
path = normalizePath(path);
|
||||
|
||||
// 先检查排除规则(优先级更高)
|
||||
for (let pattern of excludeArray) {
|
||||
if (matchPattern(path, pattern)) {
|
||||
return false; // 被排除,不拦截
|
||||
}
|
||||
}
|
||||
|
||||
// 再检查拦截规则
|
||||
for (let pattern of exeArray) {
|
||||
if (matchPattern(path, pattern)) {
|
||||
return true; // 需要拦截
|
||||
}
|
||||
}
|
||||
|
||||
return false; // 默认不拦截
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准化路径
|
||||
*/
|
||||
function normalizePath(path) {
|
||||
if (!path) return '/';
|
||||
if (!path.startsWith('/')) return '/' + path;
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增强版模式匹配
|
||||
*/
|
||||
function matchPattern(path, pattern) {
|
||||
// 处理空值
|
||||
if (!pattern) return false;
|
||||
|
||||
pattern = pattern.trim();
|
||||
|
||||
// /** 匹配所有
|
||||
if (pattern === '/**' || pattern === '**') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 处理前置和后置通配符
|
||||
if (pattern === '*' || pattern === '/*') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 精确匹配
|
||||
if (!pattern.includes('*')) {
|
||||
return path === pattern || path === normalizePath(pattern);
|
||||
}
|
||||
|
||||
// 转换模式为正则表达式
|
||||
const regexStr = pattern
|
||||
// 转义正则特殊字符
|
||||
.replace(/[.+?^${}()|[\]\\]/g, '\\$&')
|
||||
// 处理 ** 通配符(匹配多级目录)
|
||||
.replace(/\/\*\*/g, '(/.*)?')
|
||||
// 处理 * 通配符(匹配单级目录)
|
||||
.replace(/\*/g, '[^/]*')
|
||||
// 确保匹配完整路径
|
||||
.replace(/^\//, '^/')
|
||||
.replace(/$/, '$');
|
||||
|
||||
try {
|
||||
const regex = new RegExp(regexStr);
|
||||
return regex.test(path);
|
||||
} catch (e) {
|
||||
console.error(`Invalid pattern: ${pattern}`, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// =========================== AI 生成的弹窗代码
|
||||
|
||||
function initTanChuangFun() {
|
||||
|
||||
// 配置项
|
||||
const CONFIG = {
|
||||
correctPassword: 'sa-token yyds', // 正确密码
|
||||
gzhImageUrl: './big-file/contact/lykj-gzh.jpg',
|
||||
wechatImageUrl: './big-file/doc/zong/doc-lock-pre-wx.png'
|
||||
};
|
||||
|
||||
// 弹窗HTML模板
|
||||
const modalHTML = `
|
||||
<div class="modal-overlay" id="passwordModal">
|
||||
<div class="modal">
|
||||
<div class="modal-header">
|
||||
<h2>🔒 本章节已锁定,输入密码后即可正常访问:</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="error-message" id="errorMessage">密码错误,请重新输入!</p>
|
||||
|
||||
<div class="password-form">
|
||||
<input type="text" class="password-input" id="passwordInput" placeholder="关注公众号可查看密码" autocomplete="off">
|
||||
|
||||
<div class="form-actions">
|
||||
<button class="form-btn btn-verify" id="verifyBtn">验证</button>
|
||||
<button class="form-btn btn-back" id="backBtn">回首页</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="password-help-section">
|
||||
<div class="help-text" style="text-align: center;">
|
||||
关注公众号可查看密码:
|
||||
</div>
|
||||
|
||||
<div class="images-container" style="text-align: center;">
|
||||
<div class="qr-image-container" style="border: 0;">
|
||||
<img src="${CONFIG.gzhImageUrl}" alt="QQ 群公告" class="qr-image" style="width: 200px; height: 200px; margin: 0 auto; ">
|
||||
<div class="image-label">关注后点击 [私信],点击菜单栏下方 [ 文档密码 ]</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="image-overlay" id="imageOverlay">
|
||||
<img src="" alt="放大图片" class="enlarged-image" id="enlargedImage">
|
||||
</div>
|
||||
`;
|
||||
|
||||
// 初始化变量
|
||||
let passwordModal, passwordInput, errorMessage, verifyBtn, backBtn;
|
||||
let imageOverlay, enlargedImage;
|
||||
|
||||
|
||||
let okCallFn = null;
|
||||
let backCallFn = null;
|
||||
|
||||
/**
|
||||
* 初始化弹窗
|
||||
* 将弹窗HTML插入到页面中,并绑定事件
|
||||
*/
|
||||
function initModal() {
|
||||
// 插入弹窗HTML到页面
|
||||
document.body.insertAdjacentHTML('beforeend', modalHTML);
|
||||
|
||||
// 获取DOM元素
|
||||
passwordModal = document.getElementById('passwordModal');
|
||||
passwordInput = document.getElementById('passwordInput');
|
||||
errorMessage = document.getElementById('errorMessage');
|
||||
verifyBtn = document.getElementById('verifyBtn');
|
||||
backBtn = document.getElementById('backBtn');
|
||||
imageOverlay = document.getElementById('imageOverlay');
|
||||
enlargedImage = document.getElementById('enlargedImage');
|
||||
|
||||
// 绑定事件
|
||||
bindEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定所有事件
|
||||
*/
|
||||
function bindEvents() {
|
||||
// 触发按钮点击事件
|
||||
// document.getElementById('accessBtn').addEventListener('click', openModal);
|
||||
|
||||
// 验证按钮点击事件
|
||||
verifyBtn.addEventListener('click', validatePassword);
|
||||
|
||||
// 返回按钮点击事件
|
||||
backBtn.addEventListener('click', function(){
|
||||
closeModal();
|
||||
backCallFn();
|
||||
});
|
||||
|
||||
// 输入框回车事件
|
||||
passwordInput.addEventListener('keypress', function(e) {
|
||||
if (e.key === 'Enter') {
|
||||
validatePassword();
|
||||
}
|
||||
});
|
||||
|
||||
// 只在非移动端绑定图片点击事件
|
||||
if (!isMobileDevice()) {
|
||||
// 图片点击放大事件
|
||||
document.querySelectorAll('.qr-image').forEach(img => {
|
||||
img.addEventListener('click', function() {
|
||||
enlargeImage(this.src);
|
||||
});
|
||||
});
|
||||
|
||||
// 放大图片关闭事件
|
||||
imageOverlay.addEventListener('click', function(e) {
|
||||
if (e.target === this || e.target === enlargedImage) {
|
||||
closeImageOverlay();
|
||||
}
|
||||
});
|
||||
|
||||
// ESC键关闭放大图片
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape' && imageOverlay.classList.contains('active')) {
|
||||
closeImageOverlay();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测是否为移动设备
|
||||
* @returns {boolean} 是否为移动设备
|
||||
*/
|
||||
function isMobileDevice() {
|
||||
return window.innerWidth <= 768;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开密码弹窗
|
||||
*/
|
||||
function openModal() {
|
||||
passwordModal.classList.add('active');
|
||||
passwordInput.focus();
|
||||
errorMessage.classList.remove('show');
|
||||
passwordInput.value = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭密码弹窗
|
||||
*/
|
||||
function closeModal() {
|
||||
passwordModal.classList.remove('active');
|
||||
}
|
||||
|
||||
/**
|
||||
* 密码验证函数
|
||||
* 宽松验证策略:允许左右空格,中间空格可省略
|
||||
*/
|
||||
function validatePassword() {
|
||||
let enteredPassword = passwordInput.value.trim(); // 去除左右空格
|
||||
|
||||
// 标准化:移除所有空格
|
||||
const normalizedEntered = enteredPassword.replace(/\s+/g, '');
|
||||
const normalizedCorrect = CONFIG.correctPassword.replace(/\s+/g, '');
|
||||
|
||||
if (normalizedEntered === normalizedCorrect) {
|
||||
// 密码正确,解锁章节
|
||||
unlockChapter();
|
||||
} else {
|
||||
// 密码错误,显示错误信息
|
||||
showError();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示密码错误提示
|
||||
*/
|
||||
function showError() {
|
||||
errorMessage.classList.add('show');
|
||||
passwordInput.value = '';
|
||||
passwordInput.focus();
|
||||
|
||||
// 添加抖动效果
|
||||
passwordInput.classList.add('shake');
|
||||
setTimeout(() => {
|
||||
passwordInput.classList.remove('shake');
|
||||
}, 500);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解锁章节
|
||||
*/
|
||||
function unlockChapter() {
|
||||
closeModal();
|
||||
okCallFn();
|
||||
|
||||
|
||||
// // 更新章节内容
|
||||
// const lockedSection = document.querySelector('.locked-section');
|
||||
// const tocLockedItems = document.querySelectorAll('.toc a.locked');
|
||||
|
||||
// // 更新章节显示
|
||||
// lockedSection.innerHTML = `
|
||||
// <h3><i class="fas fa-unlock-alt" style="color:#2ecc71;"></i> 章节已解锁</h3>
|
||||
// <p>感谢您加入我们的社区!现在您可以查看高级配置指南的全部内容。</p>
|
||||
// <div style="text-align: left; margin-top: 20px;">
|
||||
// <h4>高级配置内容示例:</h4>
|
||||
// <p>1. 自定义插件开发:详细讲解如何为项目开发自定义插件,包括插件结构、API接口和最佳实践。</p>
|
||||
// <p>2. 性能调优指南:深入分析项目性能瓶颈,并提供多种优化方案和调优技巧。</p>
|
||||
// <p>3. 高级集成方案:介绍如何将项目与其他流行框架和工具进行深度集成。</p>
|
||||
// <p>4. 企业级部署:针对生产环境的企业级部署方案,包括高可用、负载均衡和监控配置。</p>
|
||||
// </div>
|
||||
// <p style="margin-top: 20px; color: #27ae60; font-weight: 600;">
|
||||
// <i class="fas fa-check-circle"></i> 您现在可以访问所有高级章节内容了!
|
||||
// </p>
|
||||
// `;
|
||||
|
||||
// // 更新目录状态
|
||||
// tocLockedItems.forEach(item => {
|
||||
// if (item.textContent.includes('高级配置指南')) {
|
||||
// item.classList.remove('locked');
|
||||
// item.innerHTML = '<i class="fas fa-unlock-alt" style="color:#2ecc71;"></i> 高级配置指南';
|
||||
// }
|
||||
// });
|
||||
|
||||
// // 显示成功通知
|
||||
// showNotification('章节解锁成功!您现在可以访问高级配置指南。');
|
||||
}
|
||||
|
||||
/**
|
||||
* 放大图片
|
||||
* @param {string} src - 图片地址
|
||||
*/
|
||||
function enlargeImage(src) {
|
||||
enlargedImage.src = src;
|
||||
imageOverlay.classList.add('active');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭图片放大层
|
||||
*/
|
||||
function closeImageOverlay() {
|
||||
imageOverlay.classList.remove('active');
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示通知
|
||||
* @param {string} message - 通知内容
|
||||
*/
|
||||
function showNotification(message) {
|
||||
const notification = document.createElement('div');
|
||||
notification.style.cssText = `
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
background-color: #2ecc71;
|
||||
color: white;
|
||||
padding: 15px 25px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
|
||||
z-index: 1001;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
transform: translateX(150%);
|
||||
transition: transform 0.5s ease;
|
||||
`;
|
||||
|
||||
notification.innerHTML = `<i class="fas fa-check-circle"></i><span>${message}</span>`;
|
||||
document.body.appendChild(notification);
|
||||
|
||||
// 显示通知
|
||||
setTimeout(() => {
|
||||
notification.style.transform = 'translateX(0)';
|
||||
}, 10);
|
||||
|
||||
// 3秒后隐藏
|
||||
setTimeout(() => {
|
||||
notification.style.transform = 'translateX(150%)';
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(notification);
|
||||
}, 500);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加抖动动画样式
|
||||
*/
|
||||
function addShakeAnimation() {
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
@keyframes shake {
|
||||
0%, 100% { transform: translateX(0); }
|
||||
10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
|
||||
20%, 40%, 60%, 80% { transform: translateX(5px); }
|
||||
}
|
||||
.shake {
|
||||
animation: shake 0.5s;
|
||||
border-color: #e74c3c !important;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
|
||||
// 初始化
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
initModal();
|
||||
addShakeAnimation();
|
||||
});
|
||||
|
||||
// 显示弹窗: 验证成功的回调、点击返回的回调
|
||||
window.showDocLock = function(okFn, backFn) {
|
||||
okCallFn = okFn;
|
||||
backCallFn = backFn;
|
||||
// 打开
|
||||
openModal();
|
||||
}
|
||||
|
||||
};
|
||||
initTanChuangFun();
|
||||
@@ -15,7 +15,7 @@ var docLockPlugin = function(hook, vm) {
|
||||
|
||||
// 钩子函数:每次路由切换时数据全部加载完成后调用,没有参数。
|
||||
hook.doneEach(function() {
|
||||
isShowTanChuang(vm);
|
||||
// isShowTanChuang(vm);
|
||||
});
|
||||
|
||||
// 钩子函数:初始化并第一次加载完成数据后调用,没有参数。
|
||||
@@ -33,7 +33,7 @@ var docLockPlugin = function(hook, vm) {
|
||||
const dl_AllowDisparity = 1000 * 60 * 60 * 24 * 30 * 1; // 1个月
|
||||
// 拦截 path ,如果填 /** 代表所有路径,填 /sso/* 代表 /sso/ 目录下所有路径
|
||||
const dl_exeArray = [
|
||||
'/sso/*', '/oauth2/*', '/more/common-questions'
|
||||
'/sso/*', '/oauth2/*', '/more/common-questions', '/up/*', '/micro/*', '/plugin/*'
|
||||
];
|
||||
// 排除 path
|
||||
const dl_excludeArray = [
|
||||
|
||||
@@ -27,7 +27,9 @@ var myDocsifyPlugin = function(hook, vm) {
|
||||
'<footer>',
|
||||
'<span>发现错误? 您可以在 <a href="' + url + '" target="_blank">Gitee</a> 或 <a href="' + url2 +
|
||||
'" target="_blank">GitHub</a> 帮助我们完善此页文档!</span>',
|
||||
'或 <a href="#/more/join-group">加入讨论群</a> 交流反馈',
|
||||
'或 <a href="#/more/join-group">加入讨论群</a> 交流反馈。',
|
||||
'<br/><br/>',
|
||||
'<a href="https://beian.miit.gov.cn/" target="_blank" style="color:#aaa; border-color: #aaa;">鲁ICP备18046274号-4</a>',
|
||||
'</footer>'
|
||||
].join('');
|
||||
return html + footer;
|
||||
|
||||
@@ -1412,4 +1412,28 @@ var donateList = [
|
||||
"msg": '感谢您的开源项目!',
|
||||
"date": "2025-09-19"
|
||||
},
|
||||
{
|
||||
"name": "Linex(赞赏码)",
|
||||
"link": "",
|
||||
"money": 0.01,
|
||||
"msg": '感谢您的开源项目!',
|
||||
"date": "2026-01-27"
|
||||
},
|
||||
{
|
||||
"name": "Json.张(赞赏码)",
|
||||
"link": "",
|
||||
"money": 1.0,
|
||||
"msg": '小小心意',
|
||||
"date": "2026-01-27"
|
||||
},
|
||||
{
|
||||
"name": "Nafil-鱼泡直聘运营(微信打赏)",
|
||||
"link": "",
|
||||
"money": 18.88,
|
||||
"msg": '感谢您的开源项目!',
|
||||
"date": "2026-01-29"
|
||||
},
|
||||
|
||||
|
||||
|
||||
]
|
||||
Reference in New Issue
Block a user