diff --git a/src/main.js b/src/main.js index 3b235c7..aa10586 100644 --- a/src/main.js +++ b/src/main.js @@ -19,12 +19,15 @@ import store from './store' import '@/icons/index' // icon import '@/permission' // 权限import axios from 'axios'; import '@/styles/index.scss' // global css +import { + asyncRouterMap, +} from '@/router/index' Vue.use(ElementUI) Vue.config.productionTip = false Vue.prototype.axios = axios - +console.log(asyncRouterMap) new Vue({ el: '#app', router, diff --git a/src/router/index.js b/src/router/index.js index 215bb2a..316e7be 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -161,8 +161,6 @@ export const asyncRouterMap = [{ { path: 'unit', name: 'unit', - noDropdown: false, - hidden: false, component: () => import('@/views/system/unit'), meta: { title: '单位设置', @@ -179,8 +177,6 @@ export const asyncRouterMap = [{ { path: 'formdesigner', name: 'formdesigner', - noDropdown: false, - hidden: false, component: () => import('@/views/system/formdesigner'), meta: { title: '表单设计', @@ -195,3 +191,6 @@ export const asyncRouterMap = [{ hidden: true, }, ] + + +console.log(asyncRouterMap) diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index d2a074e..2978cd0 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -57,6 +57,7 @@ const permission = { const { roleauthname, } = data + const accessedRouters = filterAsyncRouter(asyncRouterMap, roleauthname) commit('SET_ROUTERS', accessedRouters) diff --git a/src/views/system/role.vue b/src/views/system/role.vue index 51893f6..9a10441 100644 --- a/src/views/system/role.vue +++ b/src/views/system/role.vue @@ -254,6 +254,6 @@ export default { this.fetchData(this.listQuery) }) }, - }, // + }, } diff --git a/src/views/system/unit.vue b/src/views/system/unit.vue index fe5254d..10c2420 100644 --- a/src/views/system/unit.vue +++ b/src/views/system/unit.vue @@ -105,7 +105,6 @@ export default { this.unitoptions = res.data.list; }) this.fetchUnit() - this.fetchUnit() }, methods: {