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();