Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
5a1687b45f
|
@ -12065,7 +12065,7 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.SaveTableQuestionMark(IRaCIS.Core.Application.Service.Reading.Dto.SaveTableQuestionMarkInDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.SaveTableQuestionMark(IRaCIS.Core.Application.Service.Reading.Dto.SaveTableQuestionMarkInDto,System.String)">
|
||||
<summary>
|
||||
保存表格问题标记
|
||||
</summary>
|
||||
|
|
|
@ -303,7 +303,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
await _fusionCache.RemoveAsync(CacheKeys.UserLoginError(userName));
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = _userInfo.IdentityUserId, OptType = UserOptType.ResetPassword }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.ResetPassword }, true);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
IsFirstAdd = false
|
||||
});
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = identityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.LoginModifyPassword }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = identityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.UnloginModifyPasswoed }, true);
|
||||
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
@ -605,7 +605,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
if (user.Status != model.Status)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, OptType = model.Status == UserStateEnum.Enable ? UserOptType.AccountEnable : UserOptType.AccountLocked }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = model.Id, OptType = model.Status == UserStateEnum.Enable ? UserOptType.AccountEnable : UserOptType.AccountLocked }, true);
|
||||
|
||||
}
|
||||
|
||||
|
@ -735,17 +735,17 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <summary>
|
||||
/// 发送MFA 验证邮件
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="identityUserId"></param>
|
||||
/// <param name="mfaType"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> SendMFAEmail(Guid userId, UserMFAType mfaType)
|
||||
public async Task<IResponseOutput> SendMFAEmail(Guid identityUserId, UserMFAType mfaType)
|
||||
{
|
||||
var userInfo = await _identityUserRepository.Where(u => u.Id == userId).Select(t => new { t.FullName, t.EMail }).FirstOrDefaultAsync();
|
||||
var userInfo = await _identityUserRepository.Where(u => u.Id == identityUserId).Select(t => new { t.FullName, t.EMail }).FirstOrDefaultAsync();
|
||||
|
||||
int verificationCode = new Random().Next(100000, 1000000);
|
||||
|
||||
await _mailVerificationService.SenMFAVerifyEmail(userId, userInfo.FullName, userInfo.EMail, verificationCode, (UserMFAType)mfaType);
|
||||
await _mailVerificationService.SenMFAVerifyEmail(identityUserId, userInfo.FullName, userInfo.EMail, verificationCode, (UserMFAType)mfaType);
|
||||
|
||||
var hiddenEmail = IRCEmailPasswordHelper.MaskEmail(userInfo.EMail);
|
||||
return ResponseOutput.Ok(hiddenEmail);
|
||||
|
@ -754,20 +754,19 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <summary>
|
||||
/// 验证MFA 邮件
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="identityUserId"></param>
|
||||
/// <param name="Code"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> VerifyMFACodeAsync(Guid userId, string Code)
|
||||
public async Task<IResponseOutput> VerifyMFACodeAsync(Guid identityUserId, string Code)
|
||||
{
|
||||
var verificationRecord = await _verificationCodeRepository.Where(t => t.UserId == userId && 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();
|
||||
|
||||
//检查数据库是否存在该验证码
|
||||
if (verificationRecord == null)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = userId, 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_WrongVerificationCode"]);
|
||||
}
|
||||
|
@ -776,7 +775,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
//检查验证码是否失效
|
||||
if (verificationRecord.ExpirationTime < DateTime.Now)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = userId, 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"]);
|
||||
|
||||
|
@ -788,7 +787,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
//删除验证码历史记录
|
||||
await _verificationCodeRepository.BatchDeleteNoTrackingAsync(t => t.Id == verificationRecord.Id);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = userId, OptType = UserOptType.MFALogin }, true);
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = _userInfo.UserName, TargetIdentityUserId = identityUserId, OptType = UserOptType.MFALogin }, true);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1083,7 +1082,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
userLoginReturnModel.BasicInfo.EMail = hiddenEmail;
|
||||
|
||||
//修改密码
|
||||
//修改密码 || 90天修改密码再mfa 之前
|
||||
if (userLoginReturnModel.BasicInfo.IsFirstAdd || userLoginReturnModel.BasicInfo.LoginState == 1)
|
||||
{
|
||||
//userLoginReturnModel.JWTStr = _tokenService.GetToken(userLoginReturnModel.BasicInfo);
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
|
||||
if (context.ChangeType == ChangeType.Added)
|
||||
{
|
||||
await _userLogReposiotry.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, OptType = UserOptType.AddUser }, true);
|
||||
await _userLogReposiotry.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = user.Id, OptType = UserOptType.AddUser }, true);
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue