2022-10-10 00:59:08 +08:00
<!DOCTYPE html>
< html lang = "zh" >
< head >
< meta charset = "UTF-8" >
< title > Sa-Token< / title >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" / >
2023-03-26 11:30:17 +08:00
< meta name = "description" content = "Sa-Token是一个java权限认证框架, 功能全面, 上手简单, 登录认证、权限认证、Session会话、踢人下线、账号封禁、集成Redis、前后端分离、分布式会话、微服务网关鉴权、单点登录、OAuth2.0、临时Token验证、记住我模式、模拟他人账号、临时身份切换、多账号体系、注解式鉴权、路由拦截式鉴权、花式token、自动续签、同端互斥登录、会话治理、密码加密、jwt集成、Spring集成、WebFlux集成..., 有了sa-token, 你所有的权限认证问题, 都不再是问题" >
2022-10-10 00:59:08 +08:00
< meta name = "keywords" content = "sa-token,sa-token框架,sa-token文档,java权限认证" >
< meta name = "viewport" content = "width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" >
< link rel = "shortcut icon" type = "image/x-icon" href = "logo.png" >
< link rel = "stylesheet" href = "./static/doc.css" >
< link rel = "stylesheet" href = "./static/vue.css" >
< / head >
< body >
< div class = "doc-header" >
< div class = "nav-left" >
< a href = "doc.html" >
< div class = "logo-box" >
< img src = "logo.png" title = "logo" / >
< h1 class = "logo-text" > Sa-Token< / h1 >
2023-10-18 13:22:36 +08:00
< sub > v1.37.0< / sub >
2022-10-10 00:59:08 +08:00
< / div >
< / a >
< / div >
< nav class = "nav-right" >
< div class = "sear-box p-none" tabindex = "-1" >
<!-- 加载中…… -->
< / div >
2022-10-17 18:22:48 +08:00
< select class = "select-version p-none" onchange = "location.href=this.value" >
2022-10-10 00:59:08 +08:00
< option value = "doc.html" > 最新版< / option >
2023-10-18 13:22:36 +08:00
< option value = "v/v1.36.0/doc.html" > v1.36.0< / option >
2023-09-22 03:50:55 +08:00
< option value = "v/v1.35.0/doc.html" > v1.35.0< / option >
2023-06-23 20:21:20 +08:00
< option value = "v/v1.34.0/doc.html" > v1.34.0< / option >
2023-01-11 14:35:04 +08:00
< option value = "v/v1.33.0/doc.html" > v1.33.0< / option >
2022-11-16 19:52:42 +08:00
< option value = "v/v1.32.0/doc.html" > v1.32.0< / option >
2022-10-28 11:40:44 +08:00
< option value = "v/v1.31.0/doc.html" > v1.31.0< / option >
2022-10-10 00:59:08 +08:00
< option value = "v/v1.30.0/doc/index.html" > v1.30.0< / option >
< option value = "v/v1.29.0/doc/index.html" > v1.29.0< / option >
< option value = "v/v1.28.0/doc/index.html" > v1.28.0< / option >
< option value = "v/v1.27.0/doc/index.html" > v1.27.0< / option >
< option value = "v/v1.26.0/doc/index.html" > v1.26.0< / option >
< option value = "v/v1.25.0/doc/index.html" > v1.25.0< / option >
< option value = "v/v1.24.0/doc/index.html" > v1.24.0< / option >
< option value = "v/v1.23.0/doc/index.html" > v1.23.0< / option >
< option value = "v/v1.22.0/doc/index.html" > v1.22.0< / option >
< option value = "v/v1.21.0/doc/index.html" > v1.21.0< / option >
< option value = "v/v1.20.0/doc/index.html" > v1.20.0< / option >
< option value = "v/v1.19.0/doc/index.html" > v1.19.0< / option >
< option value = "v/v1.18.0/doc/index.html" > v1.18.0< / option >
< option value = "v/v1.17.0/doc/index.html" > v1.17.0< / option >
< option value = "v/v1.16.0/doc/index.html" > v1.16.0< / option >
< option value = "v/v1.15.0/doc/index.html" > v1.15.0< / option >
< option value = "v/v1.14.0/doc/index.html" > v1.14.0< / option >
< option value = "v/v1.13.0/doc/index.html" > v1.13.0< / option >
< option value = "v/v1.12.1/doc/index.html" > v1.12.1< / option >
< option value = "v/v1.12.0/doc/index.html" > v1.12.0< / option >
< option value = "v/v1.11.0/doc/index.html" > v1.11.0< / option >
< option value = "v/v1.10.0/doc/index.html" > v1.10.0< / option >
< option value = "v/v1.9.0/doc/index.html" > v1.9.0< / option >
< option value = "v/v1.8.0/doc/index.html" > v1.8.0< / option >
< option value = "v/v1.7.0/doc/index.html" > v1.7.0< / option >
< option value = "v/v1.6.0/doc/index.html" > v1.6.0< / option >
< option value = "v/v1.5.1/doc/index.html" > v1.5.1< / option >
< option value = "v/v1.4.0/doc/index.html" > v1.4.0< / option >
< option value = "v/v1.3.0/doc/index.html" > v1.3.0< / option >
< option value = "v/v1.2.0/doc/index.html" > v1.2.0< / option >
< option value = "v/v1.1.0/doc/index.html" > v1.1.0< / option >
< option value = "v/v1.0.0/doc/index.html" > v1.0.0< / option >
2022-10-28 11:40:44 +08:00
< option value = "/" > 首页< / option >
2022-10-10 00:59:08 +08:00
< / select >
2022-10-29 12:15:57 +08:00
< div class = "zk-box p-none" >
< a class = "wzi" href = "javascript:;" >
<!-- <span>背景 </span> -->
< img class = "theme-btn" src = "static/icon/theme.svg" >
<!-- <span class="zk - icon"></span> -->
< / a >
< div class = "zk-context theme-box" >
< div >
< div style = "height: 5px;" > < / div >
< span style = "background-color: #FFFFFF;" > < / span >
< span style = "background-color: #f5f5f5;" > < / span >
< span style = "background-color: #F1FAFA;" > < / span >
< span style = "background-color: #f5f5d5;" > < / span >
< span style = "background-color: #d5f5f5;" > < / span >
< span style = "background-color: #f5e5f5;" > < / span >
< span style = "background-color: #E8E8FF;" > < / span >
< span style = "background-color: #f0f9eb;" > < / span >
< span style = "background-color: #ebe5dd;" > < / span >
< span style = "background-color: #e8f4ff;" > < / span >
<!-- <span style="background - color: #F0DAD2;"></span> -->
<!-- <span style="background - color: #f5d5d5;"></span> -->
<!-- <span style="background - color: #FFFFE0;"></span> -->
<!-- <span style="background - color: #eeeeee;"></span> -->
<!-- <span style="background - color: #f5fafe;"></span> -->
< / div >
< / div >
< / div >
2022-10-10 00:59:08 +08:00
< a class = "wzi" href = "index.html" > 首页< / a >
< a class = "wzi" href = "doc.html" > 文档< / a >
< a class = "p-none wzi" href = "#/more/link" > 案例< / a >
2022-11-04 16:51:11 +08:00
< a class = "p-none wzi" href = "#/more/demand-commit" > 需求提交< / a >
2022-10-28 12:16:52 +08:00
<!-- <a class="p - none wzi" href="#/more/blog">博客</a> -->
2023-04-05 08:09:08 +08:00
< a class = "p-none wzi" href = "#/more/join-group" > 加入讨论群< / a >
2022-10-10 00:59:08 +08:00
< a class = "p-none wzi" href = "#/more/sa-token-donate" > 赞助< / a >
2023-09-22 14:14:08 +08:00
< a class = "p-none wzi" href = "#/sso/sso-pro" > 🔥 SSO商业版< / a >
2022-10-10 00:59:08 +08:00
< div class = "zk-box" >
< a class = "wzi" href = "javascript:;" >
< span > 相关资源 < / span >
< span class = "zk-icon" > < / span >
< / a >
< div class = "zk-context" >
< div >
<!-- <a href="#/more/sa - token - donate">❤️ 赞助</a> -->
< a href = "#/more/update-log" > 更新日志< / a >
< a href = "#/more/common-questions" > 常见报错< / a >
< a href = "#/more/tj-gzh" > 推荐公众号< / a >
2022-10-28 12:16:52 +08:00
< a href = "#/more/blog" > 相关博客< / a >
2022-10-10 00:59:08 +08:00
< div class = "zk-fengexian" > < / div >
<!-- <a href="http://sa - app.dev33.cn/wall.html?name=sa - token" target="_blank">需求墙</a> -->
< a href = "#/fun/sa-token-test" > 在线考试< / a >
< a href = "#/fun/issue-template" > 在线提问< / a >
2022-11-04 16:51:11 +08:00
<!-- <a href="https://wj.qq.com/s2/10852322/0d8b/" target="_blank">需求提交</a> -->
2022-10-10 00:59:08 +08:00
< a href = "https://wj.qq.com/s2/8475114/2f6a/" target = "_blank" > 问卷调查< / a >
< / div >
< / div >
< / div >
< / nav >
< / div >
<!-- <a href="/">
< div class = "logo-box" >
< img src = "logo.png" title = "logo" / >
< h1 class = "logo-text" > Sa-Token< / h1 >
< / div >
< / a > -->
< div class = "main-box" >
< div id = "app" > 加载中...< / div >
< / div >
2023-08-09 11:29:43 +08:00
<!-- 万维广告div -->
2022-10-10 00:59:08 +08:00
< div style = "position: fixed; right: 0; bottom: 0; z-index: 10000; border: 0px #aaa solid;" >
< div class = "wwads-cn wwads-vertical" data-id = "88" style = "max-width:150px" > < / div >
< / div >
2023-08-09 11:29:43 +08:00
<!-- 小助手div -->
2023-08-09 13:33:01 +08:00
< div class = "p-none help-btn-box" style = "position: fixed; right: 40px; bottom: 330px; z-index: 10000; border: 0px #aaa solid;" >
< div class = "help-tips" style = "position: relative; left: -30px; top: -10px;" > < / div >
2023-08-09 11:29:43 +08:00
< div class = "help-btn" style = "width: 60px; height: 60px; text-align: center; border-radius: 50%; background-color: #42b983; cursor: pointer;" >
< span style = "font-size: 18px; color: #FFF; line-height: 60px;" > Help< / span >
< / div >
< / div >
2022-10-10 00:59:08 +08:00
<!-- UI逐渐显现 -->
< style type = "text/css" >
body{opacity: 0.01; transition: opacity 0.5s; background-color: #FFF;}
< / style >
< script type = "text/javascript" >
setTimeout(function() {
document.body.style.opacity = 1;
}, 1);
< / script >
<!-- -->
2023-09-12 19:26:28 +08:00
< script src = "./static/docsify-plugin.js?v=6" > < / script >
< script src = "./static/is-star-plugin.js?v=6" > < / script >
2022-10-10 00:59:08 +08:00
< script >
2023-10-18 13:22:36 +08:00
var saTokenTopVersion = '1.37.0'; // Sa-Token最新版本
2022-10-10 00:59:08 +08:00
var name = '< img style = "width: 60px; height: 60px; vertical-align: middle;" src = "logo.png" alt = "logo" / > ';
name += '< b style = "font-size: 28px; vertical-align: middle;" > Sa-Token< / b > < sub > v' + saTokenTopVersion + '< / sub > ';
window.$docsify = {
// name: name, // 名字
repo: 'https://github.com/dromara/sa-token', // github地址
// themeColor: '#06A3D7', // 主题颜色
basePath: location.pathname.substr(0, location.pathname.lastIndexOf('/') + 1), // 自动计算项目名字
// basePath: '/sa-token-doc/', // 设置文件加载的父路径, 这在一些带项目名部署的文件中非常有效
auto2top: true, // 是否在切换页面后回到顶部
// coverpage: true, // 开启封面
subMaxLevel: 4, // 标题解析层级, 写几就在目录树中解析到几级标题 ,一般写2吧也就
loadSidebar: true, // 加载自定义侧边栏 , 目录定制在: _sidebar.md 文件 (需要创建 .nojekyll 的空文件,阻止 GitHub Pages 忽略命名是下划线开头的文件)
copyCode: { // 复制插件
buttonText: '复制到剪贴板',
errorText: '错误',
successText: '复制成功'
},
topMargin: 90, // 锚点距离顶部的距离
// sidebarDisplayLevel : 1 , // 设置侧边栏显示级别
// search: 'auto', // 搜索功能
alias: {
// '/sso/_sidebar.md': '/sso/_sidebar.md',
'/.*/_sidebar.md': '/_sidebar.md'
},
// tab选项卡
tabs: {
persist : true, // 是否在刷新页面时重置选项卡
sync : true, // 页面上的多个tab是否同步切换
theme : 'classic', // 主题:'classic', 'material', false
tabComments: true, // 用注释来标注选项卡标题,例如:<!-- tab:SpringBoot -->
tabHeadings: true // 用标题+粗体来定制选项卡
},
// 自定义插件
2023-07-27 06:36:55 +08:00
plugins: [myDocsifyPlugin, window.isStarPlugin],
2022-10-10 00:59:08 +08:00
}
< / script >
< script src = "static/docsify.min.js" > < / script >
< script src = "static/docsify-copy-code.min.js" > < / script >
2022-10-20 13:06:36 +08:00
<!-- 语言合集: https://cdn.jsdelivr.net/npm/prismjs@1/components/ -->
< script src = "static/prism/prism-java.min.js" > < / script >
< script src = "static/prism/prism-gradle.min.js" > < / script >
< script src = "static/prism/prism-yaml.min.js" > < / script >
< script src = "static/prism/prism-properties.min.js" > < / script >
2022-10-10 00:59:08 +08:00
<!-- 搜索框 -->
< script src = "static/search.min.js" > < / script >
<!-- 多 tab 切换 -->
< script src = "static/docsify-tabs.min.js" > < / script >
<!-- img点击放大 -->
< script src = "static/zoom-image.min.js" > < / script >
<!-- sidebar折叠 -->
<!-- <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify - sidebar - collapse/dist/sidebar.min.css" />
< script src = "//cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js" > < / script > -->
<!-- jqeury -->
< script src = "static/jquery.min.js" > < / script >
< script src = "static/layer-v3.1.1/layer.js" > < / script >
< script >
if(window.jQuery === undefined || window.Docsify === undefined) {
var str = 'CDN 加载失败,请打开备用地址:< a href = "index-backup.html' + location.hash + '" target = "_blank" > index-backup.html< / a > ';
document.querySelector('#app').innerHTML = str;
}
< / script >
<!-- 搜索引擎自动提交 -->
< script >
(function() {
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
} else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
< / script >
2023-07-19 23:55:49 +08:00
<!-- 万维广告 -->
< script data-mode = "hash" type = "text/javascript" src = "https://cdn.wwads.cn/js/makemoney.js" async > < / script >
2022-10-26 13:20:27 +08:00
2022-10-10 00:59:08 +08:00
<!-- 百度统计 -->
< script >
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
2022-10-21 12:40:27 +08:00
hm.src = "https://hm.baidu.com/hm.js?35ad501304eae758ac6139a22a9830f5";
2022-10-10 00:59:08 +08:00
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
< / script >
< script type = "text/javascript" >
// 预览版提示
2022-10-21 11:27:29 +08:00
if(location.host === 'rc.sa-token.cc') {
const newTips = '< b > 当前文档为RC预览版文档, 仅做学习测试使用, 正式项目请使用正式版: < a href = "https://sa-token.cc/" target = "_blank" > https://sa-token.cc/< / a > < / b > ';
2022-10-10 00:59:08 +08:00
layer.alert(newTips);
}
< / script >
2022-10-17 18:19:08 +08:00
2023-08-09 11:29:43 +08:00
<!-- 小助手提示 -->
< script >
$('.help-btn').click(function(){
var str = `
< div class = "xiaozhushou-intro" >
< p > 1、你在使用 Sa-Token 时遇到任何技术难题,可以向 < sa-token 小助手 > 求助咨询。< / p >
< p > 2、该小助手不属于商业运营, 求助咨询完全免费。< / p >
< p > 3、目前该小助手属于试运营阶段, 每天只能提供大约 1 小时的求助时间。< / p >
< p > 4、根据运营效果反馈, 我们日后可能会提高求助时间, 但也可能关闭此功能。< / p >
< p > 5、该小助手由企业微信提供平台支持, 感谢企业微信。< / p >
2023-08-10 13:17:07 +08:00
< p > 6、不是 AI 是真人,不是 AI 是真人,不是 AI 是真人,重说三!< / p >
2023-08-09 11:29:43 +08:00
< p style = "margin-top: 30px;" > 打开方式:< / p >
2023-08-09 11:50:11 +08:00
< p > 1、如果你是使用 PC 端微信,请点此链接:< a href = "https://work.weixin.qq.com/kfid/kfcdd45c432fee9655f" target = "_blank" > https://work.weixin.qq.com/kfid/kfcdd45c432fee9655f< / a > < / p >
2023-08-09 11:29:43 +08:00
< p > 2、如果你是使用手机端微信, 请扫码: < / p >
< p > < img src = "https://oss.dev33.cn/sa-token/sa-token-xiaozhushou.jpg" width = "200px" > < / p >
< / div >
`;
layer.alert(str, {
title: '技术求助',
area: '550px',
offset: '10%',
})
})
2023-08-09 13:33:01 +08:00
try{
// 给个小提示
const index = layer.tips('框架技术支持,点此求助', '.help-tips', {
tips: [1, '#000'] ,//还可配置颜色
time: 5000,
});
// 改为 fixed 定位,否则它会随着滚动条移动,样式就跑偏了
$('#layui-layer' + index).css('position', 'fixed');
}catch(e){
console.error(e);
}
2023-08-09 11:29:43 +08:00
< / script >
2022-10-17 18:19:08 +08:00
<!-- 修改背景颜色 -->
< script >
// 绑定修改背景色的按钮事件
$('.theme-box span').click(function() {
let bgColor = this.style.backgroundColor;
setBg(bgColor);
localStorage.setItem('bg-color-value', bgColor)
})
// 读取上次记录
let bgColor = localStorage.getItem('bg-color-value');
if(bgColor) {
setBg(bgColor);
}
// 设置背景颜色
function setBg(bgColor) {
console.log('---- 背景颜色设定为:', bgColor);
// -------- 设置 body 背景
document.body.style.backgroundColor = bgColor;
// -------- 设置 header 头背景
// 如果是 16 进制,转 rgba
if(bgColor.indexOf('#') == 0) {
bgColor = hexToRgba(bgColor, 0.97);
}
// 如果是 rgb, 转 rgba
else if(bgColor.match(/\,/g).length == 2) {
bgColor = bgColor.replace(')', ' ,0.97)');
}
document.querySelector('.doc-header').style.backgroundColor = bgColor;
}
// 16进制 转 rgba
function hexToRgba(str, a){
a = a || 1;
var reg = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/
if(!reg.test(str)){return;}
let newStr = (str.toLowerCase()).replace(/\#/g,'')
let len = newStr.length;
if(len == 3){
let t = ''
for(var i=0;i< len ; i + + ) {
t += newStr.slice(i,i+1).concat(newStr.slice(i,i+1))
}
newStr = t
}
let arr = []; //将字符串分隔,两个两个的分隔
for(var i =0;i< 6 ; i = i+2){
let s = newStr.slice(i,i+2)
arr.push(parseInt("0x" + s))
}
return 'rgb(' + arr.join(",") + ', ' + a + ')';
}
< / script >
2023-04-17 19:00:13 +08:00
<!-- 赞助页的展开和收缩 -->
< script >
// 展开
function expandZanZhu(){
$('.zk-btn--1').hide();
$('.zk-btn--2').show();
$('.zanzhu-box').height($('.zanzhu-box table').height());
}
// 折叠
function foldZanZhu(){
$('.zanzhu-box').height(500);
$('.zk-btn--2').hide();
$('.zk-btn--1').show();
}
< / script >
2022-10-10 00:59:08 +08:00
< / body >
< / html >