diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 9bcdaacac..4217d4b94 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -123,14 +123,17 @@ namespace IRaCIS.Application.Services { throw new BusinessValidationFailedException(_localizer["User_PassWordRepeat"]); } - - await _userPassWordLogRepository.AddAsync(new UserPassWordLog() + if (oldPwd != null) { + await _userPassWordLogRepository.AddAsync(new UserPassWordLog() + { - CreateTime = DateTime.Now, - PassWord = oldPwd, - UserId = userId, - }); + CreateTime = DateTime.Now, + PassWord = oldPwd, + UserId = userId, + }); + } + await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == userId, x => new User() {