import Vue from "vue"; import Router from "vue-router"; import { PAGE_PATH } from "../config"; Vue.use(Router); const router = new Router({ mode: "hash", scrollBehavior: () => ({ x: 0, y: 0 }), routes: [ { path: "/", redirect: PAGE_PATH.workFixture }, { path: PAGE_PATH.layout, redirect: PAGE_PATH.workFixture, component: () => import("../views/Layout/index.vue"), children: [ { path: PAGE_PATH.workFixture, component: () => import("../views/WorkFixture/index.vue"), }, ], }, // { // path: PAGE_PATH.layout, // component: () => import("../views/Layout/index.vue"), // redirect: PAGE_PATH.user, // children: [ // { // path: PAGE_PATH.user, // // component: () => import("../views/User/index.vue"), // }, // { // path: PAGE_PATH.authority, // // component: () => import("../views/Authority/index.vue"), // } // ], // }, ], }); // router.beforeEach((to, from, next) => { // NProgress.start() // if(to.fullPath !== '/login' && !auth()){ // router.replace({ path: '/login'}) // return next() // } // next() // }) // router.beforeEach((to, from, next) => { // NProgress.start(); // if (to.fullPath !== "/login" && !auth()) { // next("/login"); // } else { // next(); // } // }); // router.afterEach(() => { // NProgress.done(); // }); export default router;