From b94bc8eff1f3028082c5db187eaca9ae4232c9fb Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 9 Oct 2024 15:01:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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, }); }