Преглед изворни кода

新增pro项目管理模块

Z пре 1 година
родитељ
комит
c197ded9f3

+ 12 - 1
src/api/system/organization/index.js

@@ -120,4 +120,15 @@ export async function unbindLoginName (id) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}
+/**
+ * 获取当前登陆用户数据权限部门数据
+ * @param
+ */
+export async function getCurrentUserAuthorityDeptAPI () {
+  const res = await request.post('/main/user/getCurrentUserAuthorityDepts');
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

BIN
src/assets/logo.png


BIN
src/assets/logo1.png


+ 2 - 2
src/layout/components/setting-drawer.vue

@@ -358,7 +358,7 @@ export default {
 
     getLogo() {
       logoByCode('logoCode').then(res => {
-       
+
         if (!res) {
           this.form = {
             logoName: '',
@@ -367,7 +367,7 @@ export default {
         } else {
           this.form = res
         }
-      
+
       })
     },
 

+ 13 - 6
src/layout/index.vue

@@ -265,7 +265,7 @@
 <style lang="scss">
   .ele-admin-layout {
     .ele-admin-logo {
-      font-size: 18px !important;
+      //font-size: 18px !important;
 
       img {
         width: 50px !important;
@@ -364,10 +364,17 @@
     }
   }
 
-  .ele-admin-layout .ele-admin-logo img {
-    height: auto !important;
-    width: 80px !important;
-    margin-right: 5px;
-    max-height: 35px;
+  //.ele-admin-layout .ele-admin-logo img {
+  //  height: auto !important;
+  //  width: 80px !important;
+  //  margin-right: 5px;
+  //  max-height: 35px;
+  //}
+  .ele-admin-layout .ele-admin-logo {
+    font-size: 0 !important;
+    background-image: url('@/assets/logo.png') !important;
+    background-size: cover !important;
+    background-repeat: no-repeat !important;
+    background-position: center center !important;
   }
 </style>

+ 9 - 0
src/store/modules/user.js

@@ -4,6 +4,7 @@
 import { formatMenus, toTreeData, formatTreeData } from 'ele-admin';
 import { USER_MENUS } from '@/config/setting';
 import { getResourcesTree } from '@/api/layout';
+import { getCurrentUserAuthorityDeptAPI } from '@/api/system/organization';
 const formatRouter = (list) => {
   let menuList = []; // menuType
   let authorities = [];
@@ -78,9 +79,17 @@ export default {
     // 设置登录用户的角色
     setRoles(state, roles) {
       state.roles = roles;
+    },
+    // 当前登录用户的数据权限部门数据
+    setAuthorityDept(state, info) {
+      state.authorityDept = info;
     }
   },
   actions: {
+    async getCurrentUserAuthorityDept({ commit }) {
+      const info = await getCurrentUserAuthorityDeptAPI();
+      commit('setAuthorityDept', info);
+    },
     /**
      * 请求用户信息、权限、角色、菜单
      */

+ 2 - 2
src/views/login/index.vue

@@ -146,9 +146,9 @@ export default {
             } else {
               localStorage.removeItem('accountInfo');
             }
-           
+            this.$store.dispatch('user/getCurrentUserAuthorityDept');
             this.goHome();
-           
+
           })
           .catch((e) => {
             this.loading = false;