安眼平台获取用户信息失败提示

This commit is contained in:
feng
2026-01-22 13:35:02 +08:00
parent 4f8ca1b97b
commit 3a8252e81d
2 changed files with 4 additions and 4 deletions
@@ -125,7 +125,7 @@ public class RestTemplateUtil {
if (HttpStatus.OK.equals(entity.getStatusCode()) && ObjectUtils.isNotEmpty(entity.getBody())) {
return entity.getBody();
} else {
return AnYanResult.error("天眼系统API调用失败");
return AnYanResult.error("外部平台API调用失败");
}
}
@@ -116,10 +116,10 @@ public class LoginAnYanServiceImpl implements ILoginAnYanService {
return Result.error(anYanAuthResult != null ? anYanAuthResult.getMessage() : "认证服务器无响应");
}
// 授权成功获取用户信息
// 授权成功获取用户信息(统一认证的平台接口没有做统一封装,成功和失败均返回一个不同的json字符串, 这里只能判断没有获取到用户信息则认为是失败)
AnYanUserInfoResult anYanUserInfo = anYanClient.getAnYanUserInfo(anYanAuthResult.getAccess_token());
if (anYanUserInfo == null) {
return Result.error("无法获取用户信息");
if (anYanUserInfo == null || anYanUserInfo.getEmployeeUnitDTO() == null) {
return Result.error("登录失败,请先联系本单位掌油管理员确认个人机构信息");
}
// 检查并更新用户信息