From c986cf3034f0cb16ca7557c18874e1bae3fcde1b Mon Sep 17 00:00:00 2001
From: shengzhang <2393584716@qq.com>
Date: Fri, 12 Feb 2021 01:57:31 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B7=BB=E5=8A=A0=E8=A1=8C?=
=?UTF-8?q?=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sa-token-doc/doc/fun/not-login-scene.md | 60 ++++++++--------
sa-token-doc/doc/fun/token-timeout.md | 8 +--
sa-token-doc/doc/index.html | 18 ++++-
sa-token-doc/doc/lib/index.css | 23 +++---
sa-token-doc/doc/more/link.md | 2 +-
sa-token-doc/doc/use/at-check.md | 62 ++++++++--------
sa-token-doc/doc/use/config.md | 40 +++++------
sa-token-doc/doc/use/dao-extend.md | 34 ++++-----
sa-token-doc/doc/use/login-auth.md | 1 -
sa-token-doc/doc/use/many-account.md | 16 ++---
sa-token-doc/doc/use/not-cookie.md | 71 +++++++++----------
sa-token-doc/doc/use/token-style.md | 94 ++++++++++++-------------
12 files changed, 225 insertions(+), 204 deletions(-)
diff --git a/sa-token-doc/doc/fun/not-login-scene.md b/sa-token-doc/doc/fun/not-login-scene.md
index 456d66e1..9fbf766d 100644
--- a/sa-token-doc/doc/fun/not-login-scene.md
+++ b/sa-token-doc/doc/fun/not-login-scene.md
@@ -21,38 +21,38 @@
``` java
- // 全局异常拦截(拦截项目中的NotLoginException异常)
- @ExceptionHandler(NotLoginException.class)
- public AjaxJson handlerNotLoginException(NotLoginException nle, HttpServletRequest request, HttpServletResponse response)
- throws Exception {
+// 全局异常拦截(拦截项目中的NotLoginException异常)
+@ExceptionHandler(NotLoginException.class)
+public AjaxJson handlerNotLoginException(NotLoginException nle, HttpServletRequest request, HttpServletResponse response)
+ throws Exception {
- // 打印堆栈,以供调试
- nle.printStackTrace();
-
- // 判断场景值,定制化异常信息
- String message = "";
- if(nle.getType().equals(NotLoginException.NOT_TOKEN)) {
- message = "未提供token";
- }
- else if(nle.getType().equals(NotLoginException.INVALID_TOKEN)) {
- message = "token无效";
- }
- else if(nle.getType().equals(NotLoginException.TOKEN_TIMEOUT)) {
- message = "token已过期";
- }
- else if(nle.getType().equals(NotLoginException.BE_REPLACED)) {
- message = "token已被顶下线";
- }
- else if(nle.getType().equals(NotLoginException.KICK_OUT)) {
- message = "token已被踢下线";
- }
- else {
- message = "当前会话未登录";
- }
-
- // 返回给前端
- return AjaxJson.getError(message);
+ // 打印堆栈,以供调试
+ nle.printStackTrace();
+
+ // 判断场景值,定制化异常信息
+ String message = "";
+ if(nle.getType().equals(NotLoginException.NOT_TOKEN)) {
+ message = "未提供token";
}
+ else if(nle.getType().equals(NotLoginException.INVALID_TOKEN)) {
+ message = "token无效";
+ }
+ else if(nle.getType().equals(NotLoginException.TOKEN_TIMEOUT)) {
+ message = "token已过期";
+ }
+ else if(nle.getType().equals(NotLoginException.BE_REPLACED)) {
+ message = "token已被顶下线";
+ }
+ else if(nle.getType().equals(NotLoginException.KICK_OUT)) {
+ message = "token已被踢下线";
+ }
+ else {
+ message = "当前会话未登录";
+ }
+
+ // 返回给前端
+ return AjaxJson.getError(message);
+}
```
diff --git a/sa-token-doc/doc/fun/token-timeout.md b/sa-token-doc/doc/fun/token-timeout.md
index 783f490f..cd8af6e9 100644
--- a/sa-token-doc/doc/fun/token-timeout.md
+++ b/sa-token-doc/doc/fun/token-timeout.md
@@ -34,10 +34,10 @@
例如以下代码:
``` java
- // 先检查是否已过期
- StpUtil.checkActivityTimeout();
- // 检查通过后继续续签
- StpUtil.updateLastActivityToNow();
+// 先检查是否已过期
+StpUtil.checkActivityTimeout();
+// 检查通过后继续续签
+StpUtil.updateLastActivityToNow();
```
同时,你还可以关闭框架的自动续签(在配置文件中配置 `autoRenew=false` ),此时续签操作完全由开发者控制,框架不再自动进行任何续签操作
diff --git a/sa-token-doc/doc/index.html b/sa-token-doc/doc/index.html
index 3d0c9143..7511552c 100644
--- a/sa-token-doc/doc/index.html
+++ b/sa-token-doc/doc/index.html
@@ -77,14 +77,30 @@
].join('');
return html + footer;
});
+ // 每次路由切换时数据全部加载完成后调用,没有参数。
+ hook.doneEach(function() {
+ $('pre code').each(function(){
+ var lines = $(this).text().split('\n').length;
+ var $numbering = $('