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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
| import Vue from "vue";
| import Router from "vue-router";
| import Login from "./views/Login.vue";
| import ForgetPsd from "./views/ForgetPsd.vue";
| import Layout from "./views/Layout.vue";
| import Register from "./views/Register.vue";
| import Home from "./views/Home.vue";
| import UserList from "./views/UserManage/UserList.vue";
| import UserDetail from "./views/UserManage/UserDetail.vue";
| import OrderList from "./views/OrderManage/OrderList.vue";
| import OrderDetail from "./views/OrderManage/OrderDetail.vue";
| import ModelList from './views/operateManage/productManage/ModelList.vue'
| import AddModel from './views/operateManage/productManage/AddModel.vue'
| import ProductList from './views/operateManage/productManage/ProductList.vue'
| import BannerList from './views/operateManage/productManage/BannerList.vue'
| import AddProduct from './views/operateManage/productManage/AddProduct.vue'
| import EquipmentList from './views/equipmentManage/equipmentList/index.vue'
| import EquipmentDetail from './views/equipmentManage/equipmentDetail/index.vue'
|
| import MobileLogin from "./views/MobileLogin.vue";
| import BindPhone from "./views/BindPhone.vue";
|
|
| Vue.use(Router);
|
| const originalPush = Router.prototype.push;
| Router.prototype.push = function push(location: any) {
| return (originalPush.call(this, location) as any).catch((err: any) => err);
| };
| // const originalPush = Router.prototype.push;
| // Router.prototype.push = function push(location: any) {
| // return originalPush.call(this, location).catch((err: any) => err);
| // };
|
| const router = new Router({
| mode: "history",
| routes: [
| {
| path: "/",
| name: "Login",
| component: Login
| },
|
| {
| path: "/MobileLogin",
| name: "MobileLogin",
| component: MobileLogin
| },
|
| {
| path: "/ForgetPsd",
| name: "ForgetPsd",
| component: ForgetPsd
| },
| {
| path: "/Register",
| name: "Register",
| component: Register
| },
| {
| path: "/BindPhone",
| name: "BindPhone",
| component: BindPhone
| },
| {
| path: "/Layout",
| name: "Layout",
| component: Layout,
| children: [
| {
| path: "Home",
| name: "Home",
| component: Home
| },
| {
| path: "UserList",
| name: "UserList",
| component: UserList
| },
| {
| path: "UserDetail",
| name: "UserDetail",
| component: UserDetail
| },
| {
| path: "OrderList",
| name: "OrderList",
| component: OrderList
| },
| {
| path: "OrderDetail",
| name: "OrderDetail",
| component: OrderDetail
| },
| {
| path: "ModelList",
| name: "ModelList",
| component: ModelList
| },
| {
| path: "AddModel",
| name: "AddModel",
| component: AddModel
| },
| {
| path: "ProductList",
| name: "ProductList",
| component: ProductList
| },
| {
| path: "AddProduct",
| name: "AddProduct",
| component: AddProduct
| },
| {
| path: "BannerList",
| name: "BannerList",
| component: BannerList
| },
| {
| path: "EquipmentList",
| name: "EquipmentList",
| component: EquipmentList
| },
| {
| path: "EquipmentDetail",
| name: "EquipmentDetail",
| component: EquipmentDetail
| },
| ]
| }
| ]
| });
|
| router.beforeEach((to, from, next) => {
| // console.log(to.query,from,'before')
| // if(from.path !== '/'){
| // this.CardList.details = []
| // }
| next()
| })
|
| export default router;
|
|