| | |
| | | done(); |
| | | }, |
| | | handleLogin() { |
| | | 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.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(); |
| | | // |
| | | // }); |
| | | // } |
| | | // }); |
| | | }, |
| | | getTenant() { |
| | | let domain = getTopUrl(); |