// 路由格式转换函数 function transform2RouteConfigure(route) { if(!route.children || !route.children.length) { return { ...route, component: () => import('@/views'), children: [] }; } const children = route.children .filter(item => { let permission = item.meta[permissionColumn]; return !permission || app.$store.state.user.authority.hasOwnProperty(permission) && app.$store.state.user.authority[permission] == true }).map(item => transform2RouteConfigure(item)); const game = app.$store.state.base.righttop.find(item => item.lefturl === route.lefturl).value; return { ...route, component: Layout, children, path: `/${game}${route.path}` } }