import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/bot/bulk',
    name: 'BotBulk',
    meta: {
      title: '批量新增机器人',
      keepAlive: true
    },
    component: () => import('@/view/bot/bot/bulkBot.vue')
  },
  {
    path: '/init',
    name: 'Init',
    component: () => import('@/view/init/index.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/view/login/index.vue')
  },
  {
    path: '/scanUpload',
    name: 'ScanUpload',
    meta: {
      title: '扫码上传',
      client: true
    },
    component: () => import('@/view/example/upload/scanUpload.vue')
  },
  {
    path: '/ipConfig',
    name: 'IpConfig',
    meta: {
      title: 'IP检测配置',
      keepAlive: true
    },
    component: () => import('@/view/system/ipConfig.vue')
  },
  {
    path: '/cdkManagement',
    name: 'CdkManage',
    meta: {
      title: '兑换码管理',
      keepAlive: true
    },
    component: () => import('@/view/cdk/cdkManage.vue')
  },
  {
    path: '/:catchAll(.*)',
    meta: {
      closeTab: true
    },
    component: () => import('@/view/error/index.vue')
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
