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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
| import Login from '@/pages/login/Login'
| import TabsView from '@/layouts/tabs/TabsView'
| import BlankView from '@/layouts/BlankView'
| import PageView from '@/layouts/PageView'
|
| const options = {
| routes: [
| {
| path: '/login',
| name: '登录页',
| component: Login
| },
| {
| path: '/',
| name: '首页',
| component: TabsView,
| redirect: '/login',
| children: [
| {
| path: 'dashboard',
| name: 'Dashboard',
| meta: {
| icon: 'dashboard'
| },
| component: BlankView,
| children: [
| {
| path: 'workplace',
| name: '工作台',
| component: () => import('@/pages/dashboard/workplace/WorkPlace'),
| },
| {
| path: 'analysis',
| name: '分析页',
| component: () => import('@/pages/dashboard/analysis/Analysis'),
| }
| ]
| },
| {
| path: 'form',
| name: '表单页',
| meta: {
| icon: 'form',
| },
| component: PageView,
| children: [
| {
| path: 'basic',
| name: '基础表单',
| component: () => import('@/pages/form/basic/BasicForm'),
| },
| {
| path: 'step',
| name: '分步表单',
| component: () => import('@/pages/form/step/StepForm'),
| },
| {
| path: 'advance',
| name: '高级表单',
| component: () => import('@/pages/form/advance/AdvancedForm'),
| }
| ]
| },
| {
| path: 'list',
| name: '列表页',
| meta: {
| icon: 'table'
| },
| component: PageView,
| children: [
| {
| path: 'query',
| name: '查询表格',
| component: () => import('@/pages/list/QueryList'),
| },
| {
| path: 'primary',
| name: '标准列表',
| component: () => import('@/pages/list/StandardList'),
| },
| {
| path: 'card',
| name: '卡片列表',
| component: () => import('@/pages/list/CardList'),
| },
| {
| path: 'search',
| name: '搜索列表',
| component: () => import('@/pages/list/search/SearchLayout'),
| children: [
| {
| path: 'article',
| name: '文章',
| component: () => import('@/pages/list/search/ArticleList'),
| },
| {
| path: 'application',
| name: '应用',
| component: () => import('@/pages/list/search/ApplicationList'),
| },
| {
| path: 'project',
| name: '项目',
| component: () => import('@/pages/list/search/ProjectList'),
| }
| ]
| }
| ]
| },
| {
| path: 'details',
| name: '详情页',
| meta: {
| icon: 'profile'
| },
| component: BlankView,
| children: [
| {
| path: 'basic',
| name: '基础详情页',
| component: () => import('@/pages/detail/BasicDetail')
| },
| {
| path: 'advance',
| name: '高级详情页',
| component: () => import('@/pages/detail/AdvancedDetail')
| }
| ]
| },
| {
| path: 'result',
| name: '结果页',
| meta: {
| icon: 'check-circle-o',
| },
| component: PageView,
| children: [
| {
| path: 'success',
| name: '成功',
| component: () => import('@/pages/result/Success')
| },
| {
| path: 'error',
| name: '失败',
| component: () => import('@/pages/result/Error')
| }
| ]
| },
| {
| path: 'exception',
| name: '异常页',
| meta: {
| icon: 'warning',
| },
| component: BlankView,
| children: [
| {
| path: '404',
| name: '404',
| component: () => import('@/pages/exception/404')
| },
| {
| path: '403',
| name: '403',
| component: () => import('@/pages/exception/403')
| },
| {
| path: '500',
| name: '500',
| component: () => import('@/pages/exception/500')
| }
| ]
| },
| {
| path: 'components',
| name: '小组件',
| meta: {
| icon: 'appstore-o'
| },
| component: PageView,
| children: [
| {
| path: 'taskCard',
| name: '任务卡片',
| component: () => import('@/pages/components/TaskCard')
| },
| {
| path: 'palette',
| name: '颜色复选框',
| component: () => import('@/pages/components/Palette')
| }
| ]
| }
| ]
| }
| ]
| }
|
| // 不需要登录拦截的路由配置
| const loginIgnore = {
| names: ['404'], //根据路由名称匹配
| paths: ['/login'], //根据路由fullPath匹配
| /**
| * 判断路由是否包含在该配置中
| * @param route vue-router 的 route 对象
| * @returns {boolean}
| */
| includes(route) {
| return this.names.includes(route.name) || this.paths.includes(route.path)
| }
| }
|
| export {options, loginIgnore}
|
|