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

const routes= [
    // 登录相关
    {
        path: "/",
        name: 'login',
        component: () => import("../components/Login.vue")
    },
    {
        path: "/backLogin",
        name: 'backLogin',
        component: () => import("../views/back/backLogin.vue")
    },
    {
        path: '/rescue',
        name: 'rescue',
        component: () => import("../components/Rescue.vue")
    },
    {
        path: '/backIndex',
        name: 'backIndex',
        component: () => import('../components/backIndex.vue')
    },

    // 页面组件
    {
        path: "/header",
        name: 'header',
        component: () => import("../components/Header.vue")
    },
    // 前台用户相关页面
    {
        path: '/home',
        name: 'home',
        component: () => import("../views/Home.vue")
    },
    {
        path: '/delivery',
        name: 'delivery',
        component: () => import('../views/fore/delivery.vue')
    },
    {
        path: '/check',
        name: 'check',
        component: () => import('../views/fore/check.vue')
    },
    {
        path: '/service',
        name: 'service',
        component: () => import('../views/fore/service.vue')
    },
    {
        path: '/profile',
        name: 'profile',
        component: () => import('../views/fore/profile.vue')
    },
    {
        path: '/complaint',
        name: 'complaint',
        component: () => import('../views/fore/complaint.vue')
    },
    {
        path: '/feedback',
        name: 'feedback',
        component: () => import('../views/fore/feedback.vue')
    },

    // 后台管理页面

    {
        path: '/shopp',
        name: 'shopp',
        component: () => import('../views/back/shopp.vue')
    },
    {
        path: '/addkuaidi',
        name: 'addkuaidi',
        component: () => import('../views/back/addkuaidi.vue')
    },
    {
        path: '/personal',
        name: 'personal',
        component: () => import('../views/back/personal.vue')
    },
    {
        path: '/problem',
        name: 'problem',
        component: () => import('../views/back/problem.vue')
    },
    {
        path: '/notice',
        name: 'notice',
        component: () => import('../views/back/notice.vue')
    },

    // 快递员页面
    {
        path: '/indexDeliveryman',
        name: 'indexDeliveryman',
        component: () => import('../views/courier/index.vue')
    },

    // 404 页面
    {
        path: '/:pathMatch(.*)*',
        component: () => import('../components/NotFound.vue')
    }
]
const router = createRouter({
    history: createWebHashHistory(), routes
})

export default router
