From 53614e9669737d23ef9a9dda9f1589a15b7d1f43 Mon Sep 17 00:00:00 2001 From: smallchill Date: Tue, 17 Aug 2021 14:42:49 +0800 Subject: [PATCH] =?UTF-8?q?:tada:=20=E7=99=BB=E5=BD=95=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=8F=AF=E9=85=8D=E7=BD=AE=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/website.js | 1 + src/page/login/userlogin.vue | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/config/website.js b/src/config/website.js index ba2be7f..7d811c1 100644 --- a/src/config/website.js +++ b/src/config/website.js @@ -11,6 +11,7 @@ export default { tenantMode: true, // 是否开启租户模式 tenantId: "000000", // 管理组租户编号 captchaMode: true, // 是否开启验证码模式 + switchMode: true, // 是否开启部门切换模式 lockPage: '/lock', tokenTime: 3000, tokenHeader: 'Blade-Auth', diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue index 84e07ba..50be568 100644 --- a/src/page/login/userlogin.vue +++ b/src/page/login/userlogin.vue @@ -226,15 +226,18 @@ spinner: "el-icon-loading" }); this.$store.dispatch("LoginByUsername", this.loginForm).then(() => { - 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; - } else { - this.$router.push({path: this.tagWel.value}); + 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; + loading.close(); + return false; + } } + this.$router.push({path: this.tagWel.value}); loading.close(); }).catch(() => { loading.close();