Merge pull request #1345 from dataease/pr@v1.5@refactor_disable_report_task

refactor: 定时报告迭代至下版本
This commit is contained in:
fit2cloud-chenyw 2021-12-01 10:50:29 +08:00 committed by GitHub
commit 4046846a7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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是否有效