From f0c57c643b02a0f5a60b3511dac206c9e68e06ea Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 29 May 2024 14:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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() {