import myRoutes from './my'
import appRoutes from './app'
import walletRoutes from './wallet'
import shopRoutes from './shop'
import orderRoutes from './order'
import customerRoutes from './customer'
import statisticsRoutes from './statistics'
const routes = [
  {
    path: "/login",
    name: 'login',
    component: () => import("pages/login/LoginPage.vue"),
    meta: {
      title: "登录"
    }
  },
  {
    path: "/",
    redirect:'/home'
  },
  {
    path: "/home",
    name: 'home',
    component: () => import("pages/order/OrderManagePage.vue"),
    meta: {
      title: "订单管理",
      Authorization: true,
      KeepAlive:true
    }
  },
  ...statisticsRoutes,
  // 彩民
  ...customerRoutes,
  // 订单
  ...orderRoutes,
  // 商店
  ...shopRoutes,
  // app
  ...appRoutes,
  // 钱包
  ...walletRoutes,
  // 我的
  ...myRoutes,
  // {
  //   path: '/',
  //   component: () => import('layouts/MainLayout.vue'),
  //   children: [
  //     { path: '', component: () => import('pages/IndexPage.vue') }
  //   ]
  // },

  // Always leave this as last one,
  // but you can also remove it
  {
    path: "/:catchAll(.*)*",
    component: () => import("pages/ErrorNotFound.vue")
  }
];

export default routes
// [{
//   path: '',
//   component: () => import('layouts/MainLayout.vue'),
//   children: routes.map((item) => {
//     if(item.meta?.KeepAlive){
//       item.meta.KeepAlive = 'main'
//     }
//     return item
//   })
// }];
