邮箱-错误码
This commit is contained in:
@@ -402,23 +402,23 @@ public class AccountManageService {
|
||||
* @return 1:成功 2:重置码无效 3:用户不存在
|
||||
*/
|
||||
public void resetPasswordByEmailCode(Long uid, String email, String password, String code) {
|
||||
if (!CommonUtil.checkEmailFormat(email)){
|
||||
throw new ServiceException(BusiStatus.ACCOUNT_NOT_BIND_PHONE);
|
||||
}
|
||||
emailService.validEmailAddress(email);
|
||||
|
||||
long count = accountService.countByEmail(email);
|
||||
if (count > 1L) {
|
||||
throw new ServiceException(BusiStatus.PHONE_BIND_TOO_MANY_ACCOUNT);
|
||||
throw new ServiceException(BusiStatus.EMAIL_BIND_TOO_MANY_ACCOUNT);
|
||||
}
|
||||
|
||||
Account account = accountService.getAccountByEmail(email);
|
||||
if (null == account || (null != uid && !account.getUid().equals(uid))) {
|
||||
throw new ServiceException(BusiStatus.PHONE_BIND_ERROR);
|
||||
if (null == account || !StringUtils.hasText(account.getPassword())) {
|
||||
throw new ServiceException(BusiStatus.ACCOUNT_NOT_BIND_EMAIL);
|
||||
} else if (null != uid && !account.getUid().equals(uid)) {
|
||||
throw new ServiceException(BusiStatus.ACCOUNT_BIND_EMAIL_DIFF);
|
||||
}
|
||||
|
||||
//检验验证码
|
||||
if (!emailService.verifyCodeByCache(email, code)) {
|
||||
throw new ServiceException(BusiStatus.INVALID_IDENTIFYING_CODE);
|
||||
throw new ServiceException(BusiStatus.INVALID_IDENTIFYING_EMAIL_CODE);
|
||||
}
|
||||
|
||||
accountService.resetAccountPwd(account.getUid(), password);
|
||||
|
Reference in New Issue
Block a user