From cf59838779146efa5f40812360484489a71d6b92 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Fri, 4 Jul 2025 17:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Management/UserService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 4d28e9cc6..4358964e9 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -1002,7 +1002,9 @@ namespace IRaCIS.Core.Application.Service UserOptType.LoginLockedAccount }; - var lastLoginIPRegion = await _userLogRepository.Where(t => t.ActionUserName == loginUser.UserName && userOptTypes.Contains(t.OptType)) + var actionUserName= loginUser!= null ? loginUser.UserName : userName; + + var lastLoginIPRegion = await _userLogRepository.Where(t => t.ActionUserName == actionUserName && userOptTypes.Contains(t.OptType)) .OrderByDescending(t => t.CreateTime).Select(t => t.IPRegion).FirstOrDefaultAsync(); if (lastLoginIPRegion != string.Empty)