diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index fa661236..37d8b8c7 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -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 返回的实例 diff --git a/src/views/Login/components/RegisterForm.vue b/src/views/Login/components/RegisterForm.vue index 73f276ca..a1243efa 100644 --- a/src/views/Login/components/RegisterForm.vue +++ b/src/views/Login/components/RegisterForm.vue @@ -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 返回的实例