Bläddra i källkod

添加区县权限

lkk 9 månader sedan
förälder
incheckning
d3c69baafa
2 ändrade filer med 7 tillägg och 2 borttagningar
  1. 6 1
      src/store/modules/user.js
  2. 1 1
      src/views/remote/satellite/index.vue

+ 6 - 1
src/store/modules/user.js

@@ -8,7 +8,8 @@ const user = {
     name: '',
     avatar: '',
     roles: [],
-    permissions: []
+    permissions: [],
+    deptId:''
   },
 
   mutations: {
@@ -32,6 +33,9 @@ const user = {
     },
     SET_PERMISSIONS: (state, permissions) => {
       state.permissions = permissions
+    },
+    SET_DEPTID: (state, deptId) => {
+      state.deptId = deptId
     }
   },
 
@@ -69,6 +73,7 @@ const user = {
             commit('SET_ROLES', ['ROLE_DEFAULT'])
           }
           commit('SET_ID', user.userId)
+          commit('SET_DEPTID', user.deptId)
           commit('SET_NAME', user.userName)
           commit('SET_AVATAR', avatar)
           resolve(res)

+ 1 - 1
src/views/remote/satellite/index.vue

@@ -395,7 +395,7 @@ export default {
     getDept() {
       // 查询参数
       let queryParams = {
-        deptName: undefined,
+        deptId: this.$store.state.user.deptId,
         status: undefined,
       };
       listDept(queryParams).then((res) => {