瀏覽代碼

:tada: 登录部门切换可配置是否开启

smallchill 4 年之前
父節點
當前提交
53614e9669
共有 2 個文件被更改,包括 12 次插入8 次删除
  1. 1 0
      src/config/website.js
  2. 11 8
      src/page/login/userlogin.vue

+ 1 - 0
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',

+ 11 - 8
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();