import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
const router= new Router({
    routes:[
        {
            path: '/homePage',
            component: () =>
                import ('@/views/homePage/index'),
            hidden: true
        },
        {
            path: '/publicScs',
            component: () =>
                import ('@/views/publicScs/index'),
            hidden: true
        },
        {
            path: '/cooperate',
            component: () =>
                import ('@/views/cooperate/index'),
            hidden: true
        },

        {
            path: '/aboutUs',
            component: () =>
                import ('@/views/aboutUs/index'),
            hidden: true
        },
    ]
})
router.beforeEach((to, from, next) => {
    if (to.path !== '/homePage'&& to.path !== '/publicScs'&& to.path !== '/cooperate'&& to.path !== '/aboutUs') {
        next({
            path: '/homePage'
        })
    } else {
        next();
    }
})
export default router