Explorar o código

update Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs.
修复管理员名称重复导致无法正常登录

Signed-off-by: Lzh666 <422235757@qq.com>

Lzh666 hai 1 ano
pai
achega
f7baca37be

+ 2 - 2
Admin.NET/Admin.NET.Core/Service/Tenant/SysTenantService.cs

@@ -157,7 +157,7 @@ public class SysTenantService : IDynamicApiController, ITransient
         isExist = await _sysTenantRep.IsAnyAsync(u => !string.IsNullOrWhiteSpace(u.Host) && u.Host == input.Host);
         if (isExist) throw Oops.Oh(ErrorCodeEnum.D1303);
 
-        isExist = await _sysUserRep.AsQueryable().ClearFilter().AnyAsync(u => u.AccountType == AccountTypeEnum.SuperAdmin && u.Account == input.AdminAccount);
+        isExist = await _sysUserRep.AsQueryable().ClearFilter().AnyAsync(u => u.Account == input.AdminAccount);
         if (isExist) throw Oops.Oh(ErrorCodeEnum.D1301);
 
         // 从库配置判断
@@ -437,7 +437,7 @@ public class SysTenantService : IDynamicApiController, ITransient
         isExist = await _sysTenantRep.IsAnyAsync(u => !string.IsNullOrWhiteSpace(u.Host) && u.Host == input.Host && u.Id != input.Id);
         if (isExist) throw Oops.Oh(ErrorCodeEnum.D1303);
 
-        isExist = await _sysUserRep.AsQueryable().ClearFilter().AnyAsync(u => u.AccountType == AccountTypeEnum.SuperAdmin && u.Account == input.AdminAccount && u.Id != input.UserId);
+        isExist = await _sysUserRep.AsQueryable().ClearFilter().AnyAsync(u => u.Account == input.AdminAccount && u.Id != input.UserId);
         if (isExist) throw Oops.Oh(ErrorCodeEnum.D1301);
 
         // Id隔离时设置与主库一致