소스 검색

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

YunaiV 6 달 전
부모
커밋
2e495f1312
2개의 변경된 파일14개의 추가작업 그리고 10개의 파일을 삭제
  1. 7 5
      src/views/Login/components/LoginForm.vue
  2. 7 5
      src/views/Login/components/RegisterForm.vue

+ 7 - 5
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 返回的实例

+ 7 - 5
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 返回的实例