
// 门墩儿招聘
import enterprise from './components/recruit/enterprise'
import personal from './components/recruit/personal'
import Layout from '@/layout'
import { setLoginType } from '@/utils/loginType'
const recruit = [
  // {
  //   path: '/home',
  //   redirect: '/recruitHome'
  // },
  {
    path: '/recruit',
    redirect: '/recruitHome'
  },
  {
    path: '/personal', // 不可删 // 个人账号登录时，缺省只能访问个人账号路由和不需要登录，防止用户在地址栏直接输入地址访问其他页面（不可删，permission中用到）
    redirect: '/recruitHome'
  },
  {
    path: '/recruitHome',
    component: Layout,
    children: [
      {
        path: '/recruitHome',
        component: () => import('@/views/recruit/personal/home'),
        name: 'recruitHome',
        meta: {
          title: '首页'
        }
      }
    ]
  },
  {
    path: '/recruit/personal/position',
    component: Layout,
    name: 'recruit',
    children: [
      {
        path: '/recruit/personal/position',
        component: () => import('@/views/recruit/personal/position'),
        name: 'recruitPosition',
        meta: {
          title: '职位'
        }
      },
      {
        path: '/recruit/personal/company',
        component: () => import('@/views/recruit/personal/company'),
        name: 'recruitCompany',
        meta: {
          title: '公司'
        }
      },
      {
        path: '/recruit/personal/position/details/:id',
        component: () => import('@/views/recruit/personal/position/components/details'),
        name: 'recruitPositionDetails',
        meta: {
          title: '职位详情'
        }
      }
    ]
  },
  {
    path: '/recruit/personal/company/details/:id',
    component: Layout,
    name: 'companyDetails',
    meta: {
      title: '企业详情'
    },
    children: [
      {
        path: '/recruit/personal/company/details/:id',
        component: () => import('@/views/recruit/enterprise/components/enterpriseDetails.vue'),
        meta: {
          title: '企业详情'
        },
      }
    ]
  }
]

setLoginType(recruit, 'personalCommon'),
setLoginType(enterprise, 'enterprise'),
setLoginType(personal, 'personal')

const routeArray = [
  ...recruit,
  ...enterprise,
  ...personal
]
export default routeArray