zhaoke hai 1 ano
pai
achega
586900bf08
Modificáronse 2 ficheiros con 5 adicións e 3 borrados
  1. 3 2
      src/getMenu.js
  2. 2 1
      src/views/systemSettings/views/newAuth/index.vue

+ 3 - 2
src/getMenu.js

@@ -50,9 +50,10 @@ router.beforeEach(async (to, from, next) => {
       } else {
         try {
           const treeData = await store.dispatch('user/getMenuInfo')
-          store.dispatch('auth/changeAuthArrs', treeData)
+          const nd = treeData.filter(item => item.auth_id)
+          store.dispatch('auth/changeAuthArrs', nd)
           // const typeData = setType(treeData, 'up_auth_id', 'auth_id')
-          const menusArray = parseMenuItem(treeData)
+          const menusArray = parseMenuItem(nd)
           const treeMenu = listToTree(menusArray, 'up_auth_id', 'auth_id')
           const dataMenu = _.unionBy(treeMenu, 'auth_id')
           const menus = parseMenu(dataMenu)

+ 2 - 1
src/views/systemSettings/views/newAuth/index.vue

@@ -174,7 +174,8 @@ export default {
       const { code, returnData
       } = await this.getQueryList(SERVICE_ID.sysAuthId, { user_id: getToken('userid') })
       if (code == 0 && returnData && returnData.length) {
-        const treeMenu = listToTree(returnData, 'up_auth_id', 'auth_id')
+        const n = returnData.filter(item => item.auth_id)
+        const treeMenu = listToTree(_.cloneDeep(n), 'up_auth_id', 'auth_id')
         const newTreeMenu = treeMenu && treeMenu.length ? treeMenu.sort((a, b) => a.show_index - b.show_index) : treeMenu
         newTreeMenu.forEach(item => {
           keys.push(item.auth_id)