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,11 +239,13 @@ const getLoginFormCache = () => {
}
//
const getTenantByWebsite = async () => {
const website = location.host
const res = await LoginApi.getTenantByWebsite(website)
if (res) {
loginData.loginForm.tenantName = res.name
authUtil.setTenantId(res.id)
if (loginData.tenantEnable === 'true') {
const website = location.host
const res = await LoginApi.getTenantByWebsite(website)
if (res) {
loginData.loginForm.tenantName = res.name
authUtil.setTenantId(res.id)
}
}
}
const loading = ref() // ElLoading.service

View File

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