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

Uat_IRC_Net8
hang 2025-01-03 09:34:59 +08:00
parent 55db1a2eab
commit ecfc603dda
4 changed files with 9 additions and 11 deletions

View File

@ -65,7 +65,7 @@
"AutoLoginOutMinutes": 1, "AutoLoginOutMinutes": 1,
"OpenLoginMFA": false, "OpenLoginMFA": true,
"ContinuousReadingTimeMin": 120, "ContinuousReadingTimeMin": 120,

View File

@ -2273,7 +2273,7 @@
<summary> <summary>
发送MFA 验证邮件 发送MFA 验证邮件
</summary> </summary>
<param name="userId"></param> <param name="identityUserId"></param>
<param name="mfaType"></param> <param name="mfaType"></param>
<returns></returns> <returns></returns>
</member> </member>
@ -2281,7 +2281,7 @@
<summary> <summary>
验证MFA 邮件 验证MFA 邮件
</summary> </summary>
<param name="userId"></param> <param name="identityUserId"></param>
<param name="Code"></param> <param name="Code"></param>
<returns></returns> <returns></returns>
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception> <exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
@ -12058,11 +12058,12 @@
<param name="inDto"></param> <param name="inDto"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.DeleteTableQuestionMark(IRaCIS.Core.Application.Service.Reading.Dto.DeleteTableQuestionMarkInDto)"> <member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.DeleteTableQuestionMark(IRaCIS.Core.Application.Service.Reading.Dto.DeleteTableQuestionMarkInDto,System.String)">
<summary> <summary>
删除表格问题标记 删除表格问题标记
</summary> </summary>
<param name="inDto"></param> <param name="inDto"></param>
<param name="param"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.SaveTableQuestionMark(IRaCIS.Core.Application.Service.Reading.Dto.SaveTableQuestionMarkInDto,System.String)"> <member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.SaveTableQuestionMark(IRaCIS.Core.Application.Service.Reading.Dto.SaveTableQuestionMarkInDto,System.String)">

View File

@ -754,12 +754,13 @@ namespace IRaCIS.Core.Application.Service
/// <summary> /// <summary>
/// 验证MFA 邮件 /// 验证MFA 邮件
/// </summary> /// </summary>
/// <param name="identityUserId"></param>
/// <param name="Code"></param> /// <param name="Code"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception> /// <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(); 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(); 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); await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.MFALoginFail }, true);
//---验证码已经过期。 //---验证码已经过期。
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]); throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]);
} }
else //验证码正确 并且 没有超时 else //验证码正确 并且 没有超时
{ {
//删除验证码历史记录 //删除验证码历史记录
await _verificationCodeRepository.BatchDeleteNoTrackingAsync(t => t.Id == verificationRecord.Id); 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); await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.MFALogin }, true);

View File

@ -167,7 +167,7 @@ namespace IRaCIS.Core.Application.Service
{ {
var userList = _userRoleRepository.Where().ToList(); var userList = _userRoleRepository.Where().ToList();
foreach (var item in userList.GroupBy(t => t.EMail.Trim())) foreach (var item in userList.GroupBy(t => t.EMail.Trim().ToLower()))
{ {
var emailUserIdList = item.Select(t => t.Id).ToList(); var emailUserIdList = item.Select(t => t.Id).ToList();