feat: 恢复备案

This commit is contained in:
chenchun
2024-10-11 16:48:11 +08:00
committed by 橙子
parent adb9849650
commit 2c6558874d
4 changed files with 8 additions and 8 deletions

View File

@@ -164,15 +164,15 @@ namespace Yi.Framework.Rbac.Application.Services
/// 验证电话号码
/// </summary>
/// <param name="str_handset"></param>
private async Task ValidationPhone(string str_handset)
private async Task ValidationPhone(string phone)
{
var res = Regex.IsMatch(str_handset, @"^\d{11}$");
var res = Regex.IsMatch(phone, @"^\d{11}$");
if (res == false)
{
throw new UserFriendlyException("手机号码格式错误!请检查");
}
if (await _userRepository.IsAnyAsync(x => x.Phone.ToString() == str_handset))
if (await _userRepository.IsAnyAsync(x => x.Phone.ToString() == phone))
{
throw new UserFriendlyException("该手机号已被注册!");
}
@@ -225,7 +225,7 @@ namespace Yi.Framework.Rbac.Application.Services
var uuid = Guid.NewGuid();
await _aliyunManger.SendSmsAsync(input.Phone, code);
await _phoneCache.SetAsync(new CaptchaPhoneCacheKey(ValidationPhoneTypeEnum.RetrievePassword, input.Phone),
await _phoneCache.SetAsync(new CaptchaPhoneCacheKey(validationPhoneType, input.Phone),
new CaptchaPhoneCacheItem(code),
new DistributedCacheEntryOptions { SlidingExpiration = TimeSpan.FromMinutes(10) });
return new