feat: 获取登陆信息错误不抛出异常

This commit is contained in:
zengxiaobo 2024-05-20 15:38:02 +08:00
parent bc6bc66f20
commit 3faa3b4f98

View File

@ -75,13 +75,14 @@ public class AxContextInterceptor implements HandlerInterceptor {
}
if (authorization.startsWith("Bearer")) {
String result;
String url = StringUtils.firstNonBlank(supplierHost, ENV_HOSTS.get(appRuntime.getEnv()));
try {
String url = StringUtils.firstNonBlank(supplierHost, ENV_HOSTS.get(appRuntime.getEnv()));
result = HTTP_CLIENT.get(url, RequestParams.FormParams.builder()
.headers(ImmutableMap.of("Authorization", authorization))
.build());
} catch (Exception ex) {
throw ResultCode.RUNTIME_EXCEPTION.toException("获取登陆信息错误" + ex.getMessage());
log.error("获取登陆信息错误, url = {}, authorization = {}", url, authorization, ex);
return false;
}
//这里是一个非标准返回
JSONObject resultJSON = JSONObject.parseObject(result);