From 04792f72902a967f00aa62537ee06cfc81536e6a Mon Sep 17 00:00:00 2001 From: click33 <2393584716@qq.com> Date: Sun, 11 May 2025 14:58:35 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20oauth2-server=20=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9C=9F=E6=AD=A3=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sa-token-doc/oauth2/oauth2-server.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 = + "