From 081e1c4b8e6654c2ede2ed6df06fbab58c2ee1f7 Mon Sep 17 00:00:00 2001 From: zuohuaijun Date: Fri, 19 Sep 2025 17:26:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8E=E4=BF=AE=E5=A4=8D=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E8=BF=87=E6=BB=A4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs | 2 +- Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs b/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs index b1fa9f11..cffbc68a 100644 --- a/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs @@ -118,7 +118,7 @@ public class SysAuthService : IDynamicApiController, ITransient //} // 判断账号是否存在 - var user = await _sysUserRep.AsQueryable().Includes(u => u.SysOrg) + var user = await _sysUserRep.AsQueryable().Includes(u => u.SysOrg).ClearFilter() .WhereIF(tenantId > 0, u => u.TenantId == tenantId) .WhereIF(!string.IsNullOrWhiteSpace(account), u => u.Account.Equals(account)) .WhereIF(!string.IsNullOrWhiteSpace(phone), u => u.Phone.Equals(phone)) diff --git a/Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs b/Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs index d439d961..de4b6b2e 100644 --- a/Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs +++ b/Admin.NET/Admin.NET.Core/Service/User/SysUserService.cs @@ -109,7 +109,7 @@ public class SysUserService : IDynamicApiController, ITransient // 是否有权操作此账号 if (!_userManager.SuperAdmin && input.AccountType is AccountTypeEnum.SuperAdmin) throw Oops.Oh(ErrorCodeEnum.D1033); - var query = _sysUserRep.AsQueryable(); + var query = _sysUserRep.AsQueryable().ClearFilter(); if (await query.AnyAsync(u => u.Account == input.Account)) throw Oops.Oh(ErrorCodeEnum.D1003); if (!string.IsNullOrWhiteSpace(input.Phone) && await query.AnyAsync(u => u.Phone == input.Phone)) throw Oops.Oh(ErrorCodeEnum.D1032); @@ -142,7 +142,7 @@ public class SysUserService : IDynamicApiController, ITransient [DisplayName("更新用户")] public virtual async Task UpdateUser(UpdateUserInput input) { - var query = _sysUserRep.AsQueryable().Where(u => u.Id != input.Id); + var query = _sysUserRep.AsQueryable().ClearFilter().Where(u => u.Id != input.Id); if (await query.AnyAsync(u => u.Account == input.Account)) throw Oops.Oh(ErrorCodeEnum.D1003); if (!string.IsNullOrWhiteSpace(input.Phone) && await query.AnyAsync(u => u.Phone == input.Phone)) throw Oops.Oh(ErrorCodeEnum.D1032);