Browse Source

账号手机号修改

master
yangpeilai 2 days ago
parent
commit
cef80f6217

+ 2
- 2
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/dto/system/AccountInfoUpdateMobileRequestDTO.java View File

private String idNum; private String idNum;
@NotBlank(message = "新手机号不能为空") @NotBlank(message = "新手机号不能为空")
private String newMobile; private String newMobile;
@NotBlank(message = "短信验证码不能为空")
private String code;
// @NotBlank(message = "短信验证码不能为空")
// private String code;
} }

+ 2
- 2
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/system/AccountInfoManagerImpl.java View File

SourceType sourceType = SourceType.findByCode(dto.getLoginSource()); SourceType sourceType = SourceType.findByCode(dto.getLoginSource());
if (sourceType == null) throw new ManagerException("来源错误"); if (sourceType == null) throw new ManagerException("来源错误");
if (sourceType != SourceType.WEB) throw new ManagerException("来源错误"); if (sourceType != SourceType.WEB) throw new ManagerException("来源错误");
String smsCode = redisManager.get(RedisKeyGenerator.getSmsCodeKey(dto.getNewMobile(), sourceType.name(), 3));
if (!dto.getCode().equals(smsCode)) throw new ManagerException("短信验证码已失效");
// String smsCode = redisManager.get(RedisKeyGenerator.getSmsCodeKey(dto.getNewMobile(), sourceType.name(), 3));
// if (!dto.getCode().equals(smsCode)) throw new ManagerException("短信验证码已失效");
//1、判断客户账户是否存在 //1、判断客户账户是否存在
AccountInfo accountInfo = accountInfoRepo.findByAccount(dto.getOldMobile()); AccountInfo accountInfo = accountInfoRepo.findByAccount(dto.getOldMobile());
if (accountInfo == null) throw new ManagerException("原手机号对应用户不存在"); if (accountInfo == null) throw new ManagerException("原手机号对应用户不存在");

Loading…
Cancel
Save