Commit 624cc144 by zhoupeng

提交导入组织架构openapi接口

parent 873e3026
...@@ -75,7 +75,8 @@ public class QiDianController { ...@@ -75,7 +75,8 @@ public class QiDianController {
@GetMapping("/logout") @GetMapping("/logout")
@ApiOperation(value = "第三方sso用户退出登录") @ApiOperation(value = "第三方sso用户退出登录")
public String logout(@RequestParam("account") String account) { public void logout(@RequestParam("account") String account, HttpServletResponse response) throws Exception {
return qiDianService.logout(account); String url = qiDianService.logout(account);
response.sendRedirect(url);
} }
} }
...@@ -482,12 +482,16 @@ public class QiDianServiceImpl implements QiDianService { ...@@ -482,12 +482,16 @@ public class QiDianServiceImpl implements QiDianService {
@Override @Override
public String logout(String account) { public String logout(String account) {
try { try {
String url = String.format(beidouOpenapiUrl+RemoteConstant.SSO_LOGOUT_API_URL, account);
Map<String, String> headers = HttpUtil.getOpenApiHeaderMap(corporationId, secret); Map<String, String> headers = HttpUtil.getOpenApiHeaderMap(corporationId, secret);
String timestamp = headers.get("timestamp");
String sign = headers.get("sign");
String signMd5= Md5Utils.string2MD5(sign);
String url = String.format(beidouOpenapiUrl+RemoteConstant.SSO_LOGOUT_API_URL, account,corporationId,timestamp,signMd5);
log.info("-----第三方sso用户退出登录------url:{},headers={}", url, JSONObject.toJSONString(headers)); log.info("-----第三方sso用户退出登录------url:{},headers={}", url, JSONObject.toJSONString(headers));
String result = HttpUtil.httpGet(url, headers); // String result = HttpUtil.httpGet(url, headers);
log.info("-----第三方sso用户退出登录,result------:{}", result); // String result = HttpUtil.httpGet(url);
return result; log.info("-----第三方sso用户退出登录,result------:{}", url);
return url;
} catch (Exception e) { } catch (Exception e) {
String errorMsg = e.getMessage(); String errorMsg = e.getMessage();
log.error("-----第三方sso登录报错了-------:{}", errorMsg); log.error("-----第三方sso登录报错了-------:{}", errorMsg);
......
...@@ -75,7 +75,7 @@ public class RemoteConstant { ...@@ -75,7 +75,7 @@ public class RemoteConstant {
/** /**
* 第三方sso登录 第三方sso用户退出登录 * 第三方sso登录 第三方sso用户退出登录
*/ */
public static String SSO_LOGOUT_API_URL = "/api/dataauth/authserver/logout/third/sso?account=%s"; public static String SSO_LOGOUT_API_URL = "/api/dataauth/authserver/logout/third/sso?account=%s&corporationId=%s&timestamp=%s&sign=%s";
/** /**
* UTF-8 字符集 * UTF-8 字符集
......
...@@ -133,7 +133,7 @@ beidou: ...@@ -133,7 +133,7 @@ beidou:
#是否同步邮件 #是否同步邮件
email: false email: false
#登录完成后回调业务地址 #登录完成后回调业务地址
consoleUrl: https://beidou.test.laiyifen.com/console consoleUrl: https://beidou.test.laiyifen.com
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment