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

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    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: '/:catchAll(.*)',
    meta: {
      closeTab: true
    },
    component: () => import('@/view/error/index.vue')
  },
  {
    path: '/kefu/login',
    name: 'ServiceLogin',
    component: () => import('@/plugin/customerservice/view/login/index.vue'),
    meta:{
      client:true
    }
  },
  {
    path: '/kefu/main',
    name: 'ServiceMain',
    component: () => import('@/plugin/customerservice/view/chat/index.vue'),
    meta:{
      client:true
    }
  },
  {
    path: '/kefu/test',
    name: 'ServiceUserTest',
    component: () => import('@/plugin/customerservice/view/chat/test.vue'),
    meta:{
      client:true
    }
  },
]

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

export default router
