|
|
@@ -31,6 +31,10 @@ public class ChangeMobileByCodeManager extends AbstractLoginManager implements L |
|
|
|
public ChangeMobileByCodeResponse serviceHandle(ChangeMobileByCodeRequest request) throws ServiceHandleException { |
|
|
|
try { |
|
|
|
long begin = System.currentTimeMillis(); |
|
|
|
AccountInfo newAccount = accountInfoRepo.findByAccount(request.getNewMobile()); |
|
|
|
if (newAccount != null){ |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("新手机号已存在账户,不可使用新手机号更换"); |
|
|
|
} |
|
|
|
if (!Lists.newArrayList(SourceType.ALI, SourceType.WECHAT).contains(request.getLoginSource())) |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("仅向小程序用户开放此功能"); |
|
|
|
String smsCode = redisManager.get(RedisKeyGenerator.getSmsCodeKey(request.getNewMobile(), request.getLoginSource().name(), 3)); |