mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-19 10:08:07 +08:00
将SSO模式三的接口调用改为签名式校验
This commit is contained in:
@@ -43,6 +43,8 @@
|
||||
if(res.code == 200) {
|
||||
localStorage.setItem('satoken', res.data);
|
||||
location.href = decodeURIComponent(back);
|
||||
} else {
|
||||
alert(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@@ -53,8 +53,15 @@ public class SsoServerController {
|
||||
|
||||
// 配置 Http 请求处理器 (在模式三的单点注销功能下用到,如不需要可以注释掉)
|
||||
sso.setSendHttp(url -> {
|
||||
return OkHttps.sync(url).get().getBody().toString();
|
||||
try {
|
||||
// 发起 http 请求
|
||||
System.out.println("发起请求:" + url);
|
||||
return OkHttps.sync(url).get().getBody().toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -46,6 +46,7 @@ public class SsoClientController {
|
||||
private void configSso(SaSsoConfig sso) {
|
||||
// 配置Http请求处理器
|
||||
sso.setSendHttp(url -> {
|
||||
System.out.println("发起请求:" + url);
|
||||
return OkHttps.sync(url).get().getBody().toString();
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user