123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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.equipmentRecord },
- {
- path: PAGE_PATH.layout,
- redirect: PAGE_PATH.equipmentRecord,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.equipmentRecord,
- component: () => import("../views/equipmentRecord/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;
|