123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- 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.user },
- //用户
- {
- path: PAGE_PATH.layout,
- redirect: PAGE_PATH.user,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.user,
- component: () => import("../views/User/index.vue"),
- },
- ],
- },
- //角色
- {
- path: PAGE_PATH.layout,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.role,
- component: () => import("../views/Role/index.vue"),
- },
- ],
- },
- //菜单
- {
- path: PAGE_PATH.layout,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.menu,
- component: () => import("../views/Menu/index.vue"),
- },
- ],
- },
- //部门
- {
- path: PAGE_PATH.layout,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.department,
- component: () => import("../views/Department/index.vue"),
- },
- ],
- },
- //岗位
- {
- path: PAGE_PATH.layout,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.station,
- component: () => import("../views/Station/index.vue"),
- },
- ],
- },
- //字典
- {
- path: PAGE_PATH.layout,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.dict,
- component: () => import("../views/Dict/index.vue"),
- },
- ],
- },
- //参数
- {
- path: PAGE_PATH.layout,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.parameter,
- component: () => import("../views/Parameter/index.vue"),
- },
- ],
- },
- //日志
- {
- path: PAGE_PATH.layout,
- redirect: PAGE_PATH.updateDaily,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.updateDaily,
- component: () => import("../views/Daily/UpdateDaily/index.vue"),
- },
- {
- path: PAGE_PATH.handleDaily,
- component: () => import("../views/Daily/HandleDaily/index.vue"),
- },
- {
- path: PAGE_PATH.loginDaily,
- component: () => import("../views/Daily/LoginDaily/index.vue"),
- },
- ],
- },
- //编码
- {
- path: PAGE_PATH.layout,
- component: () => import("../views/Layout/index.vue"),
- children: [
- {
- path: PAGE_PATH.codeRules,
- component: () => import("../views/CodeRules/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;
|