fix: 【SYSTEM 系统管理】未开启租户,不使用 url 进行租户识别

This commit is contained in:
YunaiV 2025-07-10 13:29:43 +08:00
parent 896e24dc1d
commit 2e495f1312
2 changed files with 14 additions and 10 deletions

View File

@ -239,12 +239,14 @@ const getLoginFormCache = () => {
} }
// //
const getTenantByWebsite = async () => { const getTenantByWebsite = async () => {
if (loginData.tenantEnable === 'true') {
const website = location.host const website = location.host
const res = await LoginApi.getTenantByWebsite(website) const res = await LoginApi.getTenantByWebsite(website)
if (res) { if (res) {
loginData.loginForm.tenantName = res.name loginData.loginForm.tenantName = res.name
authUtil.setTenantId(res.id) authUtil.setTenantId(res.id)
} }
}
} }
const loading = ref() // ElLoading.service const loading = ref() // ElLoading.service
// //

View File

@ -233,12 +233,14 @@ const getTenantId = async () => {
// //
const getTenantByWebsite = async () => { const getTenantByWebsite = async () => {
if (registerData.tenantEnable === 'true') {
const website = location.host const website = location.host
const res = await LoginApi.getTenantByWebsite(website) const res = await LoginApi.getTenantByWebsite(website)
if (res) { if (res) {
registerData.registerForm.tenantName = res.name registerData.registerForm.tenantName = res.name
authUtil.setTenantId(res.id) authUtil.setTenantId(res.id)
} }
}
} }
const loading = ref() // ElLoading.service const loading = ref() // ElLoading.service