Ver Fonte

feat:优化租户登录获取配置信息逻辑

韩帛霖 há 1 ano atrás
pai
commit
f7eb76ff2a
1 ficheiros alterados com 10 adições e 20 exclusões
  1. 10 20
      zkqy-ui/src/views/login.vue

+ 10 - 20
zkqy-ui/src/views/login.vue

@@ -157,33 +157,28 @@ export default {
     // 校验url
     validateTenantId() {
       let tenantCode = this.$route.query['tenantCode']
-      console.log("租户登录", tenantCode);
       if (tenantCode != null) {
         // 得到tenantId 查询裤中是否存在该租户
         isTenantExist({tenantCode: tenantCode}).then(res => {
-          if (res == undefined) this.$router.push({path: "/404"})
-          if (res.data?.tenantId) { // 判断当前编号是否存在库中
+          if (res == undefined) {
+            this.$message.warning("请访问正确地址!")
+            this.$router.push({path: "/404"})
+          } else if (res.data?.tenantId) { // 判断当前编号是否存在库中
             this.tenantId = res.data.tenantId;
             this.loginForm.tenantID = this.tenantId;
-            // 得到租户的信息
-            this.config = res.data.loginPageConfiguration
-            this.setConfig();
-            // 如果当前租户没有配置登录页面则不可访问
-            if (this.config == null && this.config == undefined) {
-              // this.$router.push({path: "/404"})
-              this.getCode();
-              this.getCookie();
-            } else {
-              this.getCode();
-              this.getCookie();
+            if (res.data.loginPageConfiguration != null) {
+              // 得到租户的信息
+              this.config = res.data.loginPageConfiguration
+              this.setConfig();
             }
+            this.getCode();
+            this.getCookie();
           } else {
             // 当前访问链接中的租户编号不存在
             this.$router.push({path: "/404"})
           }
         })
       } else {
-        console.log('跳转')
         this.$router.push({path: "/404"})
       }
     },
@@ -205,9 +200,6 @@ export default {
             process.env.VUE_APP_BASE_IMG_API + loginPageBackgroundImage
           })`;
 
-          console.log("" + `url(${
-            process.env.VUE_APP_BASE_IMG_API + loginPageBackgroundImage
-          })`)
         }
       }
 
@@ -224,7 +216,6 @@ export default {
       // 设置title
       if (loginPageTitle) {
         let titleDom = document.getElementsByClassName("title");
-        console.log(titleDom);
         if (titleDom.length > 0) {
           titleDom[0].innerHTML = loginPageTitle;
         }
@@ -233,7 +224,6 @@ export default {
       // 设置meta信息
       if (windowTitle) {
         document.title = windowTitle;
-        console.dir(document);
       }
       // 设置页面描述
       if (loginPageDescription) {