重构SSO模块

This commit is contained in:
click33
2021-08-16 02:12:02 +08:00
parent ef1bdbd867
commit 35814bbb66
19 changed files with 143 additions and 46 deletions

View File

@@ -21,8 +21,7 @@ public class SsoClientController {
String str = "<h2>Sa-Token SSO-Client 应用端</h2>" +
"<p>当前会话是否登录:" + StpUtil.isLogin() + "</p>" +
"<p><a href=\"javascript:location.href='/sso/login?back=' + encodeURIComponent(location.href);\">登录</a> " +
"<a href=\"javascript:location.href='/sso/logout?back=' + encodeURIComponent(location.href);\">注销</a></p>";
// "<a href='/sso/logout' target='_blank'>注销</a></p>"; // 上面是[跳页面]方式,这个是[RestAPI]方式 区别在于是否加了back参数
"<a href='/sso/logout?back=self'>注销</a></p>";
return str;
}

View File

@@ -26,7 +26,7 @@ public class SsoClientController {
String str = "<h2>Sa-Token SSO-Client 应用端</h2>" +
"<p>当前会话是否登录:" + StpUtil.isLogin() + "</p>" +
"<p><a href=\"javascript:location.href='/sso/login?back=' + encodeURIComponent(location.href);\">登录</a>" +
" <a href='/sso/logout' target='_blank'>注销</a></p>";
" <a href='/sso/logout?back=self'>注销</a></p>";
return str;
}

View File

@@ -4,12 +4,6 @@ server:
# sa-token配置
sa-token:
# Token名称
token-name: satoken
# Token有效期
timeout: 2592000
# Token风格
token-style: uuid
# SSO-相关配置
sso:
# SSO-Server端 单点登录地址