更新 src/router/index.js
恢复原文件
This commit is contained in:
parent
6151ed40d7
commit
bcecd6833c
@ -72,19 +72,6 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
api.system.index.get().then((response) => {
|
api.system.index.get().then((response) => {
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
// 缓存
|
// 缓存
|
||||||
// console.log(response.data)
|
|
||||||
response.data.menu[1].children.push({
|
|
||||||
component: "system/application",
|
|
||||||
meta:{ type: "application", icon: "x-icon-chrome-filled", title: "应用插件管理", app: "admin" },
|
|
||||||
app:"admin",
|
|
||||||
icon:"x-icon-code",
|
|
||||||
title:"应用插件管理",
|
|
||||||
type:"application",
|
|
||||||
name:"systemapplication",
|
|
||||||
path:"/system/application",
|
|
||||||
redirect:""
|
|
||||||
})
|
|
||||||
|
|
||||||
for (const key in response.data) {
|
for (const key in response.data) {
|
||||||
tool.data.set(key, response.data[key]);
|
tool.data.set(key, response.data[key]);
|
||||||
if (key == 'layout') {
|
if (key == 'layout') {
|
||||||
@ -168,14 +155,12 @@ function loadComponent(component) {
|
|||||||
function flatAsyncRoutes(routes, breadcrumb = []) {
|
function flatAsyncRoutes(routes, breadcrumb = []) {
|
||||||
let res = []
|
let res = []
|
||||||
routes.forEach(route => {
|
routes.forEach(route => {
|
||||||
const tmp = {
|
const tmp = { ...route
|
||||||
...route
|
|
||||||
}
|
}
|
||||||
if (tmp.children) {
|
if (tmp.children) {
|
||||||
let childrenBreadcrumb = [...breadcrumb]
|
let childrenBreadcrumb = [...breadcrumb]
|
||||||
childrenBreadcrumb.push(route)
|
childrenBreadcrumb.push(route)
|
||||||
let tmpRoute = {
|
let tmpRoute = { ...route
|
||||||
...route
|
|
||||||
}
|
}
|
||||||
tmpRoute.meta.breadcrumb = childrenBreadcrumb
|
tmpRoute.meta.breadcrumb = childrenBreadcrumb
|
||||||
delete tmpRoute.children
|
delete tmpRoute.children
|
||||||
@ -195,8 +180,7 @@ function flatAsyncRoutes(routes, breadcrumb = []) {
|
|||||||
}
|
}
|
||||||
//过滤树
|
//过滤树
|
||||||
function treeFilter(tree, func) {
|
function treeFilter(tree, func) {
|
||||||
return tree.map(node => ({
|
return tree.map(node => ({ ...node
|
||||||
...node
|
|
||||||
})).filter(node => {
|
})).filter(node => {
|
||||||
node.children = node.children && treeFilter(node.children, func)
|
node.children = node.children && treeFilter(node.children, func)
|
||||||
return func(node) || (node.children && node.children.length)
|
return func(node) || (node.children && node.children.length)
|
||||||
|
Loading…
Reference in New Issue
Block a user