@@ -754,12 +754,13 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <summary>
|
||||
/// 验证MFA 邮件
|
||||
/// </summary>
|
||||
/// <param name="identityUserId"></param>
|
||||
/// <param name="Code"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
public async Task<IResponseOutput> VerifyMFACodeAsync(Guid identityUserId, string Code)
|
||||
public async Task<IResponseOutput> VerifyMFACodeAsync(string Code)
|
||||
{
|
||||
var identityUserId = _userInfo.IdentityUserId;
|
||||
|
||||
var verificationRecord = await _verificationCodeRepository.Where(t => t.UserId == identityUserId && t.Code == Code && t.CodeType == VerifyType.Email).OrderByDescending(x => x.ExpirationTime).FirstOrDefaultAsync();
|
||||
VerifyEmialGetDoctorInfoOutDto result = new VerifyEmialGetDoctorInfoOutDto();
|
||||
|
||||
@@ -778,13 +779,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.MFALoginFail }, true);
|
||||
//---验证码已经过期。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]);
|
||||
|
||||
|
||||
}
|
||||
else //验证码正确 并且 没有超时
|
||||
{
|
||||
|
||||
|
||||
//删除验证码历史记录
|
||||
await _verificationCodeRepository.BatchDeleteNoTrackingAsync(t => t.Id == verificationRecord.Id);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.MFALogin }, true);
|
||||
|
||||
Reference in New Issue
Block a user