diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index bc420be2c..a45af0b2d 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -98,13 +98,18 @@ namespace IRaCIS.Core.Application.Service } - if (oldPwd != null) + if (oldPwd == null) + { + oldPwd = await _userRepository.Where(x => x.Id == userId).Select(x => x.Password).FirstOrDefaultAsync(); + } + + if (!oldPwd.IsNotNullOrEmpty()) { await _userPassWordLogRepository.AddAsync(new UserPassWordLog() { CreateTime = DateTime.Now, - PassWord = oldPwd, + PassWord = oldPwd!, UserId = userId, }); }