import {createRouter, createWebHistory} from 'vue-router'
import type {RouteRecordRaw} from "vue-router"

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/index',
    },
    {
        path: '/index',
        name: 'index',
        component: () => import('@/views/index/index.vue'),
        meta: {
            title: '宜宾市12345数据大屏',
        }
    },
    {
        path: '/seats',
        name: 'seats',
        component: () => import('@/views/seats/index.vue'),
        meta: {
            title: '宜宾市12345坐席监控中心',
        }
    }, {
        path: '/home',
        name: 'home',
        component: () => import('@/views/home/index.vue'),
        meta: {
            title: '宜宾市12345政务服务便民热线',
        }
    },
    {
        path: '/:pathMatch(.*)',
        name: 'notFound',
        component: () => import('@/views/error/404.vue'),
        meta: {
            title: '404',
            isHide: true,
        },
    },
]
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes,
})

router.beforeEach((to, from, next) => {
    next();
})

export default router
