修改mfa 登录
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-01-03 09:34:59 +08:00
parent 55db1a2eab
commit ecfc603dda
4 changed files with 9 additions and 11 deletions
@@ -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);