import app from '@/qiankun/app'
const Layout = () => import('@/layout/Index')
const BlankLayout = () => import('@/layout/components/BlankLayout')
const Qiankun = () => import('@/views/admin/qiankun/Index')

// 微前端路由
const appsRouter = app.map(item => {
  return {
    path: `${item.activeRule}*`,
    meta: { title: item.name, isMenu: false },
    component: Qiankun
  }
})

// 微前端blank路由
const appsBlankRouter = app.map(item => {
  return {
    path: `${item.activeRule}blank/*`,
    meta: { title: item.name, isMenu: false },
    component: Qiankun
  }
})
export default [
  {
    path: '/blank',
    meta: { title: '布局' },
    name: 'layout',
    component: BlankLayout,
    children: appsBlankRouter
  },
  {
    path: '/',
    meta: { title: '布局' },
    name: 'layout',
    component: Layout,
    children: appsRouter
  }
]
