import Auth from '@/student/layout/auth'
import { router, rootRouter } from './routes-common'

type metaType = {
  isRegister: boolean
}

const noLoginRouter = []

export default [
  {
    path: '/',
    component: Auth,
    redirect: '/shopMall',
    children: [
      ...router,
      {
        path: '/login',
        name: 'login',
        component: () => import('@/student/layout/login'),
        meta: {
          isRegister: false
        } as metaType
      },

      {
        path: '/tradeRecord',
        name: 'tradeRecord',
        component: () => import('@/student/trade/index'),
        meta: {
          title: '交易记录'
        }
      }
    ]
  },
  ...noLoginRouter,
  ...rootRouter,
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/404'),
    meta: {
      title: '404 Not Fund',
      platform: 'STUDENT'
    }
  }
]
