import {createRouter, createWebHashHistory} from "vue-router";
import type {RouteRecordRaw} from "vue-router";
const defaultRouterList: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/pages/login/index.vue'),
    },
    {
        path: '/base',
        redirect: '/base/list',
        component: () => import('@/pages/base/index.vue'),
        children: [
            {
                path: 'list',
                name: 'list',
                component: () => import('@/pages/list/index.vue'),
            },
            {
                path: 'reservation',
                name: 'reservation',
                component: () => import('@/pages/reservation/index.vue'),
            },
            {
                path: 'record',
                name: 'record',
                component: () => import('@/pages/record/index.vue'),
            },
            {
                path: 'settings',
                name: 'settings',
                component: () => import('@/pages/settings/index.vue'),
            }
        ]
    }

]
const allRoutes = [...defaultRouterList]
const router = createRouter({
    history: createWebHashHistory(),
    routes: allRoutes
});

export default router;