邮箱-绑定-错误码
This commit is contained in:
@@ -935,7 +935,8 @@ public enum BusiStatus {
|
||||
INVALID_IDENTIFYING_EMAIL_CODE(3015, "邮件驗證碼不正確"),
|
||||
EMAIL_CODE_NOT_EXPIRED(3016, "已發送了驗證碼邮件.請等一分鐘后再試"),
|
||||
EMAIL_CODE_IP_TO_OFTEN(3019, "獲取邮件验证码過於頻繁"),
|
||||
EMAIL_VERIFY_CODE_ERROR(211174, "邮件驗證碼校驗失敗"),
|
||||
EMAIL_VERIFY_CODE_ERROR(3020, "邮件驗證碼校驗失敗"),
|
||||
EMAIL_HAD_BOUND_BY_OTHER(3021, "邮箱已经绑定其他帐号"),
|
||||
;
|
||||
|
||||
private final int value;
|
||||
|
@@ -1410,18 +1410,17 @@ public class UsersService extends BaseService {
|
||||
|
||||
public void boundEmail(Long uid, String email, String code) {
|
||||
if (usersBaseService.checkEmailExists(email)) {
|
||||
//todo code
|
||||
throw new ServiceException(BusiStatus.THE_PHONE_NUMBER_HAS_BEEN_REGISTERED);
|
||||
throw new ServiceException(BusiStatus.EMAIL_HAD_BOUND_BY_OTHER);
|
||||
}
|
||||
|
||||
if (!emailService.verifyEmailCode(email, code)) {
|
||||
throw new ServiceException(BusiStatus.SMSCODEERROR);
|
||||
throw new ServiceException(BusiStatus.EMAIL_VERIFY_CODE_ERROR);
|
||||
}
|
||||
|
||||
usersBaseService.boundEmail(uid, email);
|
||||
|
||||
//记录最近30天内绑定手机号
|
||||
jedisService.setex(RedisKey.blind_phone_sign.getKey(String.valueOf(uid)),
|
||||
jedisService.setex(RedisKey.blind_email_sign.getKey(String.valueOf(uid)),
|
||||
30 * 24 * 60 * 60, String.valueOf(new Date().getTime()));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user