From a9804b08da67f83df85a1a31a72af3601e36901d Mon Sep 17 00:00:00 2001 From: zuohuaijun Date: Fri, 19 Sep 2025 01:47:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8E1=E3=80=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3=20=202=E3=80=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=A7=9F=E6=88=B7=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=20=203=E3=80=81=E5=8D=87=E7=BA=A7=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin.NET.Core/Admin.NET.Core.csproj | 8 ++--- .../Service/Auth/SysAuthService.cs | 33 +++++++++---------- .../Admin.NET.Test/Admin.NET.Test.csproj | 4 +-- Admin.NET/Admin.NET.sln | 4 +-- Web/package.json | 8 ++--- .../system/tenant/component/editTenant.vue | 6 ++-- 6 files changed, 30 insertions(+), 33 deletions(-) diff --git a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj index 95368d49..84f8e1bf 100644 --- a/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj +++ b/Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj @@ -22,15 +22,15 @@ - + - - - + + + diff --git a/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs b/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs index 9703d294..b1fa9f11 100644 --- a/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs @@ -21,7 +21,7 @@ public class SysAuthService : IDynamicApiController, ITransient private readonly SysConfigService _sysConfigService; private readonly SysCacheService _sysCacheService; private readonly SysTenantService _sysTenantService; - + private readonly IHttpContextAccessor _httpContextAccessor; private readonly ICaptcha _captcha; private readonly IEventPublisher _eventPublisher; @@ -118,7 +118,7 @@ public class SysAuthService : IDynamicApiController, ITransient //} // 判断账号是否存在 - var user = await _sysUserRep.AsQueryable().Includes(t => t.SysOrg) + var user = await _sysUserRep.AsQueryable().Includes(u => u.SysOrg) .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)) @@ -135,6 +135,19 @@ public class SysAuthService : IDynamicApiController, ITransient return user; } + /// + /// 根据域名获取租户ID 🔖 + /// + /// + /// + [DisplayName("根据域名获取租户ID")] + [AllowAnonymous] + public long GetTenantIdByHostname(string hostname) + { + var tenant = _sysCacheService.Get>(CacheConst.KeyTenant).FirstOrDefault(u => u.Host == hostname); + return tenant != null ? tenant.Id : 0; + } + /// /// 验证用户密码 /// @@ -409,20 +422,4 @@ public class SysAuthService : IDynamicApiController, ITransient return 401; } } - - /// - /// 根据域名获取租户ID 🔖 - /// - /// - [SuppressMonitor] - [DisplayName("根据域名获取租户ID")] - [AllowAnonymous] - public long GetTenantIdByHostname(string hostname) - { - var list = _sysCacheService.Get>(CacheConst.KeyTenant); - var tenant = list.Find(p => p.Host.Contains(hostname)); - if(tenant != null) - return tenant.Id; - return 0; - } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Test/Admin.NET.Test.csproj b/Admin.NET/Admin.NET.Test/Admin.NET.Test.csproj index 4b8c60b6..612d79c1 100644 --- a/Admin.NET/Admin.NET.Test/Admin.NET.Test.csproj +++ b/Admin.NET/Admin.NET.Test/Admin.NET.Test.csproj @@ -14,8 +14,8 @@ - - + + compile diff --git a/Admin.NET/Admin.NET.sln b/Admin.NET/Admin.NET.sln index 4b54f6bf..a7cc8391 100644 --- a/Admin.NET/Admin.NET.sln +++ b/Admin.NET/Admin.NET.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 18 -VisualStudioVersion = 18.0.11010.61 d18.0 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36511.14 d17.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Admin.NET.Application", "Admin.NET.Application\Admin.NET.Application.csproj", "{C3F5AEC5-ACEE-4109-94E3-3F981DC18268}" EndProject diff --git a/Web/package.json b/Web/package.json index 425df1cc..ed1c9791 100644 --- a/Web/package.json +++ b/Web/package.json @@ -2,7 +2,7 @@ "name": "admin.net.pro", "type": "module", "version": "2.4.33", - "lastBuildTime": "2025.09.17", + "lastBuildTime": "2025.09.19", "description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架", "author": "zuohuaijun", "license": "MIT", @@ -81,8 +81,8 @@ "vue-router": "^4.5.1", "vue-signature-pad": "^3.0.2", "vue3-tree-org": "^4.2.2", - "vxe-pc-ui": "^4.9.31", - "vxe-table": "^4.16.13", + "vxe-pc-ui": "^4.9.32", + "vxe-table": "^4.16.14", "xe-utils": "^3.7.9", "xlsx-js-style": "^1.2.0" }, @@ -111,7 +111,7 @@ "sass": "^1.92.1", "terser": "^5.44.0", "typescript": "^5.9.2", - "vite": "^7.1.5", + "vite": "^7.1.6", "vite-auto-i18n-plugin": "^1.1.9", "vite-plugin-cdn-import": "^1.0.1", "vite-plugin-compression2": "^2.2.1", diff --git a/Web/src/views/system/tenant/component/editTenant.vue b/Web/src/views/system/tenant/component/editTenant.vue index 74802bb3..1ea9ca3a 100644 --- a/Web/src/views/system/tenant/component/editTenant.vue +++ b/Web/src/views/system/tenant/component/editTenant.vue @@ -10,7 +10,7 @@ - + ID隔离 库隔离 @@ -78,12 +78,12 @@ - + - +