refactor: 定时报告迭代至下版本

This commit is contained in:
fit2cloud-chenyw 2021-12-01 10:48:06 +08:00
parent f6548e7cc8
commit 0a99b6a358

View File

@ -74,7 +74,9 @@ router.beforeEach(async(to, from, next) => {
})
export const loadMenus = (next, to) => {
buildMenus().then(res => {
const filterDatas = filterRouter(res.data)
const datas = res.data
disableSomeMenu(datas)
const filterDatas = filterRouter(datas)
const asyncRouter = filterAsyncRouter(filterDatas)
asyncRouter.push({ path: '*', redirect: '/404', hidden: true })
store.dispatch('permission/GenerateRoutes', asyncRouter).then(() => { // 存储路由
@ -87,6 +89,17 @@ export const loadMenus = (next, to) => {
})
})
}
const disableSomeMenu = datas => {
datas.forEach(menu => {
if (menu.name === 'system') {
menu.children.forEach(item => {
if (item.name === 'sys-task') {
item.children = [item.children[0]]
}
})
}
})
}
/**
* 验证path是否有效