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

View File

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