|
|
@ -162,9 +162,12 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { |
|
|
|
logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getPhone(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg())); |
|
|
|
throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode()); |
|
|
|
} |
|
|
|
//2、根据手机号校验用户是否存在
|
|
|
|
String url = ThirdApiConstant.THIRD_PAUSER_CHECKPAUSER + formDTO.getPhone(); |
|
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, null); |
|
|
|
//2、根据数据来源和手机号校验用户是否存在
|
|
|
|
CheckPaUserFormDTO dto = new CheckPaUserFormDTO(); |
|
|
|
dto.setPhone(formDTO.getPhone()); |
|
|
|
dto.setSource(formDTO.getSource()); |
|
|
|
String url = ThirdApiConstant.THIRD_PAUSER_CHECKPAUSER; |
|
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(dto)); |
|
|
|
if (!result.success()) { |
|
|
|
logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getPhone(), result.getCode(), result.getMsg())); |
|
|
|
throw new RenException(result.getCode()); |
|
|
@ -201,9 +204,12 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public UserTokenResultDTO loginByPhone(TokenDto tokenDTO, LoginByPhoneFormDTO formDTO) { |
|
|
|
//1.根据手机号查询到用户、客户信息
|
|
|
|
String url = ThirdApiConstant.THIRD_PAUSER_CHECKPAUSER + formDTO.getPhone(); |
|
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, null); |
|
|
|
//1.根据数据来源和手机号查询用户、客户信息
|
|
|
|
CheckPaUserFormDTO dto = new CheckPaUserFormDTO(); |
|
|
|
dto.setPhone(formDTO.getPhone()); |
|
|
|
dto.setSource(formDTO.getSource()); |
|
|
|
String url = ThirdApiConstant.THIRD_PAUSER_CHECKPAUSER; |
|
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(dto)); |
|
|
|
if (!result.success()) { |
|
|
|
logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getPhone(), result.getCode(), result.getMsg())); |
|
|
|
throw new RenException(result.getCode()); |
|
|
@ -244,6 +250,7 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { |
|
|
|
visited.setUserId(userDTO.getId()); |
|
|
|
visited.setLogonUserId(tokenDTO.getUserId()); |
|
|
|
visited.setPhone(formDTO.getPhone()); |
|
|
|
visited.setSource(formDTO.getSource()); |
|
|
|
String saveUserVisitedUrl = ThirdApiConstant.THIRD_PAUSERVISITED_SAVEUSERVISITED; |
|
|
|
Result<String> visitedResult = HttpClientManager.getInstance().sendPostByJSON(saveUserVisitedUrl, JSON.toJSONString(visited)); |
|
|
|
if(!visitedResult.success()){ |
|
|
@ -269,7 +276,7 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { |
|
|
|
JSONObject toResult = JSON.parseObject(data); |
|
|
|
Result result = ConvertUtils.mapToEntity(toResult, Result.class); |
|
|
|
if (!result.success()) { |
|
|
|
logger.error("调用epmet_third服务初始化用户信息失败"); |
|
|
|
logger.error(String.format("调用epmet_third服务初始化用户信息失败,数据来源[%s],手机号[%s],userId:[%S]", formDTO.getSource(), formDTO.getPhone(), formDTO.getUserId())); |
|
|
|
throw new RenException(result.getCode()); |
|
|
|
} |
|
|
|
Object RegisterResult = result.getData(); |
|
|
|