wangting
2024-04-02 b38eb035c3782025257d9b582e5a0db45f7881b8
Source/ProjectWeb/src/page/login/userlogin.vue
@@ -109,15 +109,15 @@
      };
    },
    created() {
      this.getTenant();
     // this.getTenant();
    },
    mounted() {
      //在mounted获取首页下拉菜单数据
      this.$axios.get('/api/blade-system/tenant/tenant-map').then(res=>{
      /*this.$axios.get('/api/blade-system/tenant/tenant-map').then(res=>{
        if(res.data.code == 200){
          this.loginForm.region=res.data.data
        }
      })
      })*/
    },
    watch: {
      'loginForm.deptId'() {
@@ -165,36 +165,36 @@
        done();
      },
      handleLogin() {
        // this.$router.push({path: this.tagWel.value});
        // this.$refs.loginForm.validate(valid => {
        //   if (valid) {
        //     const loading = this.$loading({
        //       lock: true,
        //       text: '登录中,请稍后。。。',
        //       spinner: "el-icon-loading"
        //     });
        //     this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
        //       if (this.website.switchMode) {
        //         const deptId = this.userInfo.dept_id;
        //         const roleId = this.userInfo.role_id;
        //         if (deptId.includes(",") || roleId.includes(",")) {
        //           this.loginForm.deptId = deptId;
        //           this.loginForm.roleId = roleId;
        //           this.userBox = true;
        //           this.$store.dispatch("LogOut").then(() => {
        //             loading.close();
        //           });
        //           return false;
        //         }
        //       }
        //       this.$router.push({path: this.tagWel.value});
        //       loading.close();
        //     }).catch(() => {
        //       loading.close();
        //
        //     });
        //   }
        // });
        this.$router.push({path: this.tagWel.value});
        this.$refs.loginForm.validate(valid => {
          if (valid) {
            const loading = this.$loading({
              lock: true,
              text: '登录中,请稍后。。。',
              spinner: "el-icon-loading"
            });
            this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
              if (this.website.switchMode) {
                const deptId = this.userInfo.deptOid;
                const roleId = this.userInfo.userOid;
                if (deptId.includes(",") || roleId.includes(",")) {
                  this.loginForm.deptId = deptId;
                  this.loginForm.roleId = roleId;
                  this.userBox = true;
                  this.$store.dispatch("LogOut").then(() => {
                    loading.close();
                  });
                  return false;
                }
              }
              this.$router.push({path: this.tagWel.value});
              loading.close();
            }).catch(() => {
              loading.close();
            });
          }
        });
      },
      getTenant() {
        let domain = getTopUrl();