维护密码历史日志
continuous-integration/drone/push Build is passing Details

Uat_IRC_Net8
hang 2025-01-21 15:16:40 +08:00
parent ac8875acdf
commit a06e7a9a2c
1 changed files with 8 additions and 1 deletions

View File

@ -160,7 +160,7 @@ namespace IRaCIS.Core.Application.Service
/// </summary>
/// <returns></returns>
[AllowAnonymous]
public async Task<IResponseOutput> UserMutiAccount([FromServices] IRepository<IdentityUser> _identityUserRepository)
public async Task<IResponseOutput> UserMutiAccount([FromServices] IRepository<IdentityUser> _identityUserRepository, [FromServices] IRepository<UserPassWordLog> _userPasswordLogRepository)
{
if ((await _identityUserRepository.FirstOrDefaultAsync()) == null)
@ -187,6 +187,13 @@ namespace IRaCIS.Core.Application.Service
await _identityUserRepository.AddAsync(identityUser);
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => emailUserIdList.Contains(t.Id), u => new UserRole() { IdentityUserId = identityUserId });
if (emailUserIdList.Count == 1)
{
var userRoleId = emailUserIdList.First();
await _userPasswordLogRepository.BatchUpdateNoTrackingAsync(t => t.UserId == userRoleId, u => new UserPassWordLog() { IdentityUserId = identityUserId });
}
}
await _identityUserRepository.SaveChangesAsync();