diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 905d6ee26..7f9958d86 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -970,19 +970,21 @@ namespace IRaCIS.Core.Application.Service if (existUserLoginInfo.LastLoginIP != string.Empty) { + //设置上次登录的IP + await _identityUserRepository.BatchUpdateNoTrackingAsync(x => x.Id == existUserLoginInfo.Id, x => new IdentityUser() + { + LastLoginIP = iPRegion, + LastLoginTime = DateTime.Now + + }); + + // 与上一次区域不一致 if (SplitAndConcatenate(existUserLoginInfo.LastLoginIP) != SplitAndConcatenate(iPRegion)) { isLoginUncommonly = true; - //设置上次登录的IP - await _identityUserRepository.BatchUpdateNoTrackingAsync(x => x.Id == existUserLoginInfo.Id, x => new IdentityUser() - { - LastLoginIP = iPRegion, - LastLoginTime = DateTime.Now - - }); if (loginUser != null) {