fix: 修复找回密码问题

This commit is contained in:
橙子
2024-10-13 01:04:58 +08:00
parent 82ad9e249a
commit f27a5a135b

View File

@@ -171,11 +171,6 @@ namespace Yi.Framework.Rbac.Application.Services
{ {
throw new UserFriendlyException("手机号码格式错误!请检查"); throw new UserFriendlyException("手机号码格式错误!请检查");
} }
if (await _userRepository.IsAnyAsync(x => x.Phone.ToString() == phone))
{
throw new UserFriendlyException("该手机号已被注册!");
}
} }
@@ -210,6 +205,13 @@ namespace Yi.Framework.Rbac.Application.Services
PhoneCaptchaImageDto input) PhoneCaptchaImageDto input)
{ {
await ValidationPhone(input.Phone); await ValidationPhone(input.Phone);
//注册的手机号验证,是不能已经注册过的
if (validationPhoneType == ValidationPhoneTypeEnum.Register&& await _userRepository.IsAnyAsync(x => x.Phone.ToString() == input.Phone))
{
throw new UserFriendlyException("该手机号已被注册!");
}
var value = await _phoneCache.GetAsync(new CaptchaPhoneCacheKey(validationPhoneType, input.Phone)); var value = await _phoneCache.GetAsync(new CaptchaPhoneCacheKey(validationPhoneType, input.Phone));
//防止暴刷 //防止暴刷