From 73f5e67e3cec21e346d6c369dc3cc12757094d3f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 18 Mar 2025 13:55:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E8=B4=A6=E6=88=B7=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 9e20440da..905d6ee26 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -336,7 +336,7 @@ namespace IRaCIS.Core.Application.Service ////查找改邮箱或者手机的用户 var existUser = await _identityUserRepository.Where(t => t.EMail == email && t.Status == UserStateEnum.Enable).FirstOrDefaultAsync(); - if (existUser==null) + if (existUser == null) { //---邮箱错误。 return ResponseOutput.NotOk(_localizer["User_EmailError"]); @@ -535,7 +535,7 @@ namespace IRaCIS.Core.Application.Service if (user != null) { - user.AccountList = await _userRoleRepository.Where(t => t.IdentityUserId == identityUserId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + user.AccountList = await _userRoleRepository.Where(t => t.IdentityUserId == identityUserId).ProjectTo(_mapper.ConfigurationProvider).OrderBy(t => t.UserTypeShortName).ToListAsync(); } return user; @@ -947,7 +947,7 @@ namespace IRaCIS.Core.Application.Service var loginUser = await _identityUserRepository.Where(u => (u.UserName.Equals(userName) || u.EMail.Equals(userName)) && u.Password == password).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync(); - var existUserLoginInfo = await _identityUserRepository.Where(u => u.UserName == userName ||u.EMail==userName).Select(t => new { t.LastLoginIP, t.LastChangePassWordTime, t.Id }).FirstOrDefaultAsync(); + var existUserLoginInfo = await _identityUserRepository.Where(u => u.UserName == userName || u.EMail == userName).Select(t => new { t.LastLoginIP, t.LastChangePassWordTime, t.Id }).FirstOrDefaultAsync(); var isExistAccount = existUserLoginInfo != null; @@ -1037,7 +1037,7 @@ namespace IRaCIS.Core.Application.Service await _fusionCache.SetAsync(cacheKey, 0, TimeSpan.FromMinutes(lockoutMinutes)); - await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName=loginUser.UserName, OptType = UserOptType.Login, IsLoginUncommonly = isLoginUncommonly }, true); + await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = loginUser.IdentityUserId, ActionUserName = loginUser.UserName, OptType = UserOptType.Login, IsLoginUncommonly = isLoginUncommonly }, true); userLoginReturnModel.BasicInfo = loginUser; @@ -1093,7 +1093,7 @@ namespace IRaCIS.Core.Application.Service await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(identityUserId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes)); - userLoginReturnModel.BasicInfo.AccountList = await _userRoleRepository.Where(t => t.IdentityUserId == identityUserId).ProjectTo(_mapper.ConfigurationProvider).OrderBy(t=>t.UserTypeShortName).ToListAsync(); + userLoginReturnModel.BasicInfo.AccountList = await _userRoleRepository.Where(t => t.IdentityUserId == identityUserId).ProjectTo(_mapper.ConfigurationProvider).OrderBy(t => t.UserTypeShortName).ToListAsync(); userLoginReturnModel.CompanyInfo = companyInfo;