通过邮箱获取用户信息

Test_HIR_Net8
hang 2025-09-17 14:17:26 +08:00
parent 5a2136f205
commit 8356fff9ce
1 changed files with 14 additions and 0 deletions

View File

@ -521,6 +521,20 @@ namespace IRaCIS.Core.Application.Service
}
public async Task<UserDetailDTO?> GetUserByEmail(string email)
{
var user = await _identityUserRepository.Where(t => t.EMail == email).ProjectTo<UserDetailDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
if (user != null)
{
user.AccountList = await _userRoleRepository.Where(t => t.IdentityUserId == user.Id).ProjectTo<UserAccountInfo>(_mapper.ConfigurationProvider).OrderBy(t => t.UserTypeShortName).ToListAsync();
}
return user;
}
/// <summary>