|
|
@ -39,6 +39,8 @@ public class WaterRequestUtil { |
|
|
|
public String singOnAppsecret; |
|
|
|
@Value("${water.singOnUrl:}") |
|
|
|
public String singOnUrl; |
|
|
|
@Value("${water.logoutUrl:}") |
|
|
|
public String logoutUrl; |
|
|
|
|
|
|
|
//验证用户登录
|
|
|
|
@Value("${water.userUrl:}") |
|
|
@ -194,6 +196,23 @@ public class WaterRequestUtil { |
|
|
|
return JSONObject.parseObject(body, WaterResult.class); |
|
|
|
} |
|
|
|
|
|
|
|
public WaterResultV2<String> logout(String authorization) { |
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
log.info("--------请求统一门户用户注销登陆,请求地址为:{}", logoutUrl); |
|
|
|
HttpRequest get = createGet(logoutUrl, authUserServiceId, authUserAppsecret); |
|
|
|
String body; |
|
|
|
try (HttpResponse response = get.header("Authorization", authorization) |
|
|
|
.execute()) { |
|
|
|
body = response.body(); |
|
|
|
} |
|
|
|
long endTime = System.currentTimeMillis(); |
|
|
|
log.info("--------请求统一门户用户注销登陆,耗时{}毫秒,返回结果为:{}", endTime - startTime, body); |
|
|
|
WaterResultV2<String> waterResult = JSON.parseObject(body, new TypeReference<WaterResultV2<String>>() { |
|
|
|
}); |
|
|
|
isSuccess(waterResult); |
|
|
|
return waterResult; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 验证用户登录 |
|
|
|
* |
|
|
|