将SSO模式三的接口调用改为签名式校验

This commit is contained in:
click33
2022-04-29 03:23:46 +08:00
parent 5e3795e29e
commit de39d91b71
23 changed files with 575 additions and 281 deletions

View File

@@ -43,6 +43,8 @@
if(res.code == 200) {
localStorage.setItem('satoken', res.data);
location.href = decodeURIComponent(back);
} else {
alert(res.msg);
}
})
}

View File

@@ -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;
}
});
}
}

View File

@@ -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();
});
}