feat(iam): 添加日志
This commit is contained in:
+10
-4
@@ -245,12 +245,15 @@ public class LoginServiceImpl implements ILoginService {
|
||||
log.info("=======获取UserInfo请求地址:{}", userInfoUrl);
|
||||
OauthUserInfo oauthUserInfo = restTemplate.getForObject(userInfoUrl, OauthUserInfo.class);
|
||||
log.info("=======获取UserInfo请求地址返回参数:{}", oauthUserInfo);
|
||||
if (Objects.isNull(oauthUserInfo) || Objects.isNull(oauthUserInfo.getSpRoleList()) || oauthUserInfo.getSpRoleList().isEmpty()){
|
||||
throw new JeroBootException("获取用户信息返回信息为空!");
|
||||
if (Objects.isNull(oauthUserInfo)){
|
||||
throw new JeroBootException("oauthUserInfo对象为空!");
|
||||
}
|
||||
if (StringUtils.isNotBlank(oauthUserInfo.getErrCode())){
|
||||
throw new JeroBootException(oauthUserInfo.getMsg());
|
||||
}
|
||||
if (Objects.isNull(oauthUserInfo.getSpRoleList()) || oauthUserInfo.getSpRoleList().isEmpty()){
|
||||
throw new JeroBootException("spRoleList返回信息为空!");
|
||||
}
|
||||
return oauthUserInfo;
|
||||
}
|
||||
|
||||
@@ -265,12 +268,15 @@ public class LoginServiceImpl implements ILoginService {
|
||||
log.info("=======获取token请求地址:{}", accessTokenUrl);
|
||||
OauthAccessToken oauthAccessToken = restTemplate.postForObject(accessTokenUrl, null, OauthAccessToken.class);
|
||||
log.info("=======获取token请求地址返回参数:{}", oauthAccessToken);
|
||||
if (Objects.isNull(oauthAccessToken) || StringUtils.isBlank(oauthAccessToken.getAccessToken())){
|
||||
throw new JeroBootException("获取AccessToken返回信息为空!");
|
||||
if (Objects.isNull(oauthAccessToken)){
|
||||
throw new JeroBootException("oauthAccessToken对象为空!");
|
||||
}
|
||||
if (StringUtils.isNotBlank(oauthAccessToken.getErrCode())){
|
||||
throw new JeroBootException(oauthAccessToken.getMsg());
|
||||
}
|
||||
if (StringUtils.isBlank(oauthAccessToken.getAccessToken())){
|
||||
throw new JeroBootException("accessToken返回信息为空!");
|
||||
}
|
||||
return oauthAccessToken;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user