diff --git a/sa-token-doc/oauth2/oauth2-server.md b/sa-token-doc/oauth2/oauth2-server.md index 37a3323e..cdea35d6 100644 --- a/sa-token-doc/oauth2/oauth2-server.md +++ b/sa-token-doc/oauth2/oauth2-server.md @@ -144,10 +144,17 @@ public class SaOAuth2ServerController { // 配置:未登录时返回的View SaOAuth2Strategy.instance.notLoginView = () -> { - String msg = "当前会话在OAuth-Server端尚未登录,请先访问" - + " doLogin登录 " - + "进行登录之后,刷新页面开始授权"; - return msg; + // 简化模拟表单 + String doLoginCode = + "fetch(`/oauth2/doLogin?name=${document.querySelector('#name').value}&pwd=${document.querySelector('#pwd').value}`) " + + " .then(res => res.json()) " + + " .then(res => { if(res.code === 200) { location.reload() } else { alert(res.msg) } } )"; + String res = + "

当前客户端在 OAuth-Server 认证中心尚未登录,请先登录

" + + "用户:
" + + "密码:
" + + ""; + return res; }; // 配置:登录处理函数