gongjinbao
2025-01-08 00283eaef6efe95e3523f205920ab4b7538e9444
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import Vue from "vue";
import VueRouter from "vue-router";
import Layouts from "../layouts";
 
Vue.use(VueRouter);
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
 
/**
 *  path: "/login",   ------页面地址
    component: () => import("../views/login"),  ------组件地址
    meta: {
      title: "登录",    ------页面标题
      icon: "el-icon-user-solid",  ------菜单图标
      oneself: true,  ------是否在单独页面打开
      hide: true,  ------是否隐藏改菜单
    }
 */
 
const routes = [
  {
 
    path: "",
    redirect: "login",
    component: Layouts,
    children: [
      {
        path: "/login",
        meta: {
          title: "登录",
          oneself: true,
          hide: true,
          privilege: 'login'
        },
        component: () => import("../view/Login"),
      },
      {
        path: "/addOrder",
        meta: {
          title: "添加订单",
          oneself: true,
          hide: true,
          privilege: 'addOrder'
        },
        component: () => import("../view/addOrder"),
      },
    ]
  }
];
 
const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});
 
export default router;