😎1、优化登录接口 2、优化租户编辑页面 3、升级依赖
This commit is contained in:
parent
755560ee41
commit
a9804b08da
@ -22,15 +22,15 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="4.0.0" />
|
<PackageReference Include="AlibabaCloud.SDK.Dysmsapi20170525" Version="4.0.0" />
|
||||||
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.808" />
|
<PackageReference Include="AlipaySDKNet.Standard" Version="4.9.809" />
|
||||||
<PackageReference Include="AngleSharp" Version="1.3.0" />
|
<PackageReference Include="AngleSharp" Version="1.3.0" />
|
||||||
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
<PackageReference Include="AspectCore.Extensions.Reflection" Version="2.4.0" />
|
||||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||||
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" Aliases="BouncyCastleV2" />
|
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" Aliases="BouncyCastleV2" />
|
||||||
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="9.1.7" />
|
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="9.1.7" />
|
||||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.124" />
|
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.7.125" />
|
||||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.124" />
|
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.7.125" />
|
||||||
<PackageReference Include="Furion.Pure" Version="4.9.7.124" />
|
<PackageReference Include="Furion.Pure" Version="4.9.7.125" />
|
||||||
<PackageReference Include="Hardware.Info" Version="101.0.1.1" />
|
<PackageReference Include="Hardware.Info" Version="101.0.1.1" />
|
||||||
<PackageReference Include="Hashids.net" Version="1.7.0" />
|
<PackageReference Include="Hashids.net" Version="1.7.0" />
|
||||||
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
<PackageReference Include="IPTools.China" Version="1.6.0" />
|
||||||
|
|||||||
@ -21,7 +21,7 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
private readonly SysConfigService _sysConfigService;
|
private readonly SysConfigService _sysConfigService;
|
||||||
private readonly SysCacheService _sysCacheService;
|
private readonly SysCacheService _sysCacheService;
|
||||||
private readonly SysTenantService _sysTenantService;
|
private readonly SysTenantService _sysTenantService;
|
||||||
|
|
||||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
private readonly ICaptcha _captcha;
|
private readonly ICaptcha _captcha;
|
||||||
private readonly IEventPublisher _eventPublisher;
|
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(tenantId > 0, u => u.TenantId == tenantId)
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(account), u => u.Account.Equals(account))
|
.WhereIF(!string.IsNullOrWhiteSpace(account), u => u.Account.Equals(account))
|
||||||
.WhereIF(!string.IsNullOrWhiteSpace(phone), u => u.Phone.Equals(phone))
|
.WhereIF(!string.IsNullOrWhiteSpace(phone), u => u.Phone.Equals(phone))
|
||||||
@ -135,6 +135,19 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据域名获取租户ID 🔖
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hostname"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DisplayName("根据域名获取租户ID")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public long GetTenantIdByHostname(string hostname)
|
||||||
|
{
|
||||||
|
var tenant = _sysCacheService.Get<List<SysTenant>>(CacheConst.KeyTenant).FirstOrDefault(u => u.Host == hostname);
|
||||||
|
return tenant != null ? tenant.Id : 0;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 验证用户密码
|
/// 验证用户密码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -409,20 +422,4 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
return 401;
|
return 401;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 根据域名获取租户ID 🔖
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[SuppressMonitor]
|
|
||||||
[DisplayName("根据域名获取租户ID")]
|
|
||||||
[AllowAnonymous]
|
|
||||||
public long GetTenantIdByHostname(string hostname)
|
|
||||||
{
|
|
||||||
var list = _sysCacheService.Get<List<SysTenant>>(CacheConst.KeyTenant);
|
|
||||||
var tenant = list.Find(p => p.Host.Contains(hostname));
|
|
||||||
if(tenant != null)
|
|
||||||
return tenant.Id;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||||
<PackageReference Include="Furion.Xunit" Version="4.9.7.124" />
|
<PackageReference Include="Furion.Xunit" Version="4.9.7.125" />
|
||||||
<PackageReference Include="Furion.Pure" Version="4.9.7.124">
|
<PackageReference Include="Furion.Pure" Version="4.9.7.125">
|
||||||
<ExcludeAssets>compile</ExcludeAssets>
|
<ExcludeAssets>compile</ExcludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="xunit.assert" Version="2.9.3" />
|
<PackageReference Include="xunit.assert" Version="2.9.3" />
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 18
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 18.0.11010.61 d18.0
|
VisualStudioVersion = 17.14.36511.14 d17.14
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
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}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Admin.NET.Application", "Admin.NET.Application\Admin.NET.Application.csproj", "{C3F5AEC5-ACEE-4109-94E3-3F981DC18268}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "admin.net.pro",
|
"name": "admin.net.pro",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "2.4.33",
|
"version": "2.4.33",
|
||||||
"lastBuildTime": "2025.09.17",
|
"lastBuildTime": "2025.09.19",
|
||||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||||
"author": "zuohuaijun",
|
"author": "zuohuaijun",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -81,8 +81,8 @@
|
|||||||
"vue-router": "^4.5.1",
|
"vue-router": "^4.5.1",
|
||||||
"vue-signature-pad": "^3.0.2",
|
"vue-signature-pad": "^3.0.2",
|
||||||
"vue3-tree-org": "^4.2.2",
|
"vue3-tree-org": "^4.2.2",
|
||||||
"vxe-pc-ui": "^4.9.31",
|
"vxe-pc-ui": "^4.9.32",
|
||||||
"vxe-table": "^4.16.13",
|
"vxe-table": "^4.16.14",
|
||||||
"xe-utils": "^3.7.9",
|
"xe-utils": "^3.7.9",
|
||||||
"xlsx-js-style": "^1.2.0"
|
"xlsx-js-style": "^1.2.0"
|
||||||
},
|
},
|
||||||
@ -111,7 +111,7 @@
|
|||||||
"sass": "^1.92.1",
|
"sass": "^1.92.1",
|
||||||
"terser": "^5.44.0",
|
"terser": "^5.44.0",
|
||||||
"typescript": "^5.9.2",
|
"typescript": "^5.9.2",
|
||||||
"vite": "^7.1.5",
|
"vite": "^7.1.6",
|
||||||
"vite-auto-i18n-plugin": "^1.1.9",
|
"vite-auto-i18n-plugin": "^1.1.9",
|
||||||
"vite-plugin-cdn-import": "^1.0.1",
|
"vite-plugin-cdn-import": "^1.0.1",
|
||||||
"vite-plugin-compression2": "^2.2.1",
|
"vite-plugin-compression2": "^2.2.1",
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto">
|
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto">
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="租户类型" :rules="[{ required: true, message: '租户类型不能为空', trigger: 'blur' }]">
|
<el-form-item label="租户类型" prop="tenantType" :rules="[{ required: true, message: '租户类型不能为空', trigger: 'blur' }]">
|
||||||
<el-radio-group v-model="state.ruleForm.tenantType" :disabled="state.ruleForm.id != undefined">
|
<el-radio-group v-model="state.ruleForm.tenantType" :disabled="state.ruleForm.id != undefined">
|
||||||
<el-radio :value="0">ID隔离</el-radio>
|
<el-radio :value="0">ID隔离</el-radio>
|
||||||
<el-radio :value="1">库隔离</el-radio>
|
<el-radio :value="1">库隔离</el-radio>
|
||||||
@ -78,12 +78,12 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||||
<el-form-item label="数据库类型">
|
<el-form-item label="数据库类型" prop="dbType" :rules="[{ required: true, message: '数据库类型不能为空', trigger: 'blur' }]">
|
||||||
<g-sys-dict v-model="state.ruleForm.dbType" code="db_type" render-as="select" :disabled="state.ruleForm.tenantType == 0 && state.ruleForm.tenantType != undefined" />
|
<g-sys-dict v-model="state.ruleForm.dbType" code="db_type" render-as="select" :disabled="state.ruleForm.tenantType == 0 && state.ruleForm.tenantType != undefined" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||||
<el-form-item label="连接字符串">
|
<el-form-item label="连接字符串" prop="connection" :rules="[{ required: true, message: '连接字符串不能为空', trigger: 'blur' }]">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="state.ruleForm.connection"
|
v-model="state.ruleForm.connection"
|
||||||
placeholder="连接字符串"
|
placeholder="连接字符串"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user