Commit b007c7c1346508a643b37423e13a5628cd8a589d

Authored by yangzhi
1 parent 63deedae

冲突了 志哥解决了 志哥牛批

src/utils/routerList.js
1 import Layout from '@/layout' 1 import Layout from '@/layout'
2 import { getInfo } from '../store/modules/user.js' 2 import { getInfo } from '../store/modules/user.js'
3 -import { GetMenueRole } from '@/api/role'  
4 3
5 -export function getRoutes(permissions) { 4 +
  5 +export function getRoutes() {
  6 +
6 let userInfo = {} 7 let userInfo = {}
7 if (localStorage.userinfo) { 8 if (localStorage.userinfo) {
8 userInfo = JSON.parse(localStorage.userinfo) 9 userInfo = JSON.parse(localStorage.userinfo)
9 } 10 }
10 - var permissions = userInfo.permissions || [];  
11 -  
12 - // var roles = await GetMenueRole();  
13 - // roles = roles.data.map(o=>o.code);  
14 - 11 + console.log(userInfo)
15 let constantRoutes1 = [] 12 let constantRoutes1 = []
16 - if (userInfo.UserId == 1 || 1 == 1) { 13 + if (userInfo.UserId == 1) {
17 constantRoutes1 = [{ 14 constantRoutes1 = [{
18 - path: '/login', 15 + path: '/login',
  16 + component: () =>
  17 + import ('@/views/login/index'),
  18 + hidden: true
  19 + },
  20 +
  21 + {
  22 + path: '/404',
  23 + component: () =>
  24 + import ('@/views/404'),
  25 + hidden: true
  26 + },
  27 + {
  28 + path: '/answerDetail',
  29 + name: '答题详情',
  30 + component: () =>
  31 + import ('@/views/AnswerResult/detail.vue'),
  32 + hidden: true
  33 + },
  34 + {
  35 + path: '/',
  36 + component: Layout,
  37 + redirect: '/dashboard',
  38 + children: [{
  39 + path: 'dashboard',
  40 + name: '首页',
19 component: () => 41 component: () =>
20 - import ('@/views/login/index'),  
21 - hidden: true 42 + import ('@/views/dashboard/index'),
  43 + meta: {
  44 + title: '首页',
  45 + icon: 'dashboard'
  46 + }
  47 + }]
  48 + },
  49 +
  50 + {
  51 + path: '/example',
  52 + component: Layout,
  53 + redirect: '/example/table',
  54 + name: 'Example',
  55 + meta: {
  56 + title: '题库管理',
  57 + icon: 'el-icon-s-help'
22 }, 58 },
23 -  
24 - {  
25 - path: '/404', 59 + children: [{
  60 + path: 'QuestionBank',
  61 + name: 'Table',
26 component: () => 62 component: () =>
27 - import ('@/views/404'),  
28 - hidden: true 63 + import ('@/views/QuestionBank/index'),
  64 + meta: {
  65 + title: '题库',
  66 + icon: 'table'
  67 + }
  68 + }]
  69 + },
  70 +
  71 + {
  72 + path: '/views',
  73 + component: Layout,
  74 + redirect: '/views/TestPaper',
  75 + name: 'TestPaper',
  76 + meta: {
  77 + title: '试卷管理',
  78 + icon: 'el-icon-s-help'
29 }, 79 },
30 -  
31 - {  
32 - path: '/answerDetail',  
33 - name: '答题详情',  
34 - component: () =>  
35 - import ('@/views/AnswerResult/detail.vue'),  
36 - hidden: true 80 + children: [{
  81 + path: 'TestPaperList',
  82 + name: 'Table',
  83 + component: () =>
  84 + import ('@/views/TestPaper/TestPaperList'),
  85 + meta: {
  86 + title: '试卷列表',
  87 + icon: 'table'
  88 + }
  89 + },
  90 + {
  91 + path: 'ManualTestPaper',
  92 + name: 'Table',
  93 + component: () =>
  94 + import ('@/views/TestPaper/ManualTestPaper'),
  95 + meta: {
  96 + title: '组卷',
  97 + icon: 'table'
  98 + }
  99 + },
  100 +
  101 + ]
  102 + },
  103 + {
  104 + code: '用户管理',
  105 + path: '/user',
  106 + component: Layout,
  107 + redirect: '/',
  108 + name: 'user',
  109 + meta: {
  110 + title: '用户管理',
  111 + icon: 'el-icon-s-help'
37 }, 112 },
  113 + children: [{
  114 + code: '人才库',
  115 + path: 'user',
  116 + name: 'User',
  117 + component: () =>
  118 + import ('@/views/user/userlist'),
  119 + meta: {
  120 + title: '人才库',
  121 + }
  122 + },
  123 + {
  124 + code: '面试时间表',
  125 + path: 'interviewSchedule',
  126 + name: 'interviewSchedule',
  127 + component: () =>
  128 + import ('@/views/user/InterviewSchedule'),
  129 + meta: {
  130 + title: '面试时间表',
  131 + }
  132 + },
38 133
  134 + {
  135 + code: 'importuser',
  136 + path: 'importuser',
  137 + name: 'importuser',
39 138
40 - <<  
41 - << << < HEAD {  
42 - path: '/',  
43 - component: Layout,  
44 - redirect: '/dashboard',  
45 - children: [{  
46 - path: 'dashboard',  
47 - name: '首页',  
48 component: () => 139 component: () =>
49 - import ('@/views/dashboard/index'), 140 + import ('@/views/user/picuserimport'),
50 meta: { 141 meta: {
51 - title: '首页',  
52 - icon: 'dashboard' 142 + title: '图片导入用户',
53 } 143 }
54 - }, {  
55 - path: 'live',  
56 - name: '直播观看', 144 + },
  145 + {
  146 + code: 'admin',
  147 + path: 'admin',
  148 + name: 'admin',
57 component: () => 149 component: () =>
58 - import ('@/views/live/index'), 150 + import ('@/views/user/adminList'),
59 meta: { 151 meta: {
60 - title: '直播',  
61 - icon: 'video'  
62 - },  
63 - hidden: true  
64 - }] 152 + title: '管理员列表',
  153 + permissions: ['admin']
  154 + }
  155 + },
  156 +
  157 + ]
  158 + }, {
  159 + path: '/password',
  160 + component: Layout,
  161 + redirect: '/',
  162 + name: 'password',
  163 + meta: {
  164 + title: '系统管理',
  165 + icon: 'el-icon-s-platform'
65 }, 166 },
  167 + children: [{
  168 + path: 'userdimset',
  169 + name: 'impouserdimsetrtuser',
66 170
67 - {  
68 - path: '/example',  
69 - component: Layout,  
70 - redirect: '/example/table',  
71 - name: 'Example',  
72 - ===  
73 - === = {  
74 - code: 'home',  
75 - path: '/',  
76 - component: Layout,  
77 - redirect: '/dashboard',  
78 - children: [{  
79 - path: 'dashboard',  
80 - name: '首页',  
81 - component: () =>  
82 - import ('@/views/dashboard/index'),  
83 - >>>  
84 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
85 - meta: {  
86 - title: '题库管理',  
87 - icon: 'el-icon-s-help',  
88 - permissions: ['admin']  
89 - },  
90 - children: [{  
91 - path: 'QuestionBank',  
92 - name: 'Table',  
93 - component: () =>  
94 - import ('@/views/QuestionBank/index'),  
95 - meta: {  
96 - title: '题库',  
97 - icon: 'table',  
98 - permissions: ['admin']  
99 - }  
100 - }, ]  
101 - },  
102 - // {  
103 - // path: '/moduleIndex',  
104 - // component: Layout,  
105 - // redirect: '/module/index',  
106 - // name: 'module',  
107 - // meta: {  
108 - // title: '面试题',  
109 - // icon: 'el-icon-s-help'  
110 - // },  
111 - // children: [{  
112 - // path: 'index',  
113 - // name: 'index',  
114 - // component: () =>  
115 - // import ('@/views/TestPaper/index'),  
116 - // hidden: true,  
117 - // meta: {  
118 - // title: '试卷维护',  
119 - // icon: 'table'  
120 - // }  
121 - // }, ]  
122 - // },  
123 - // {  
124 - // path: '/realQuestion',  
125 - // component: Layout,  
126 - // redirect: '/module/realQuestion',  
127 - // name: 'realQuestion',  
128 - // meta: {  
129 - // title: '历年真题',  
130 - // icon: 'el-icon-s-help'  
131 - // },  
132 - // children: [{  
133 - // path: 'recharge',  
134 - // name: 'recharge',  
135 - // component: () =>  
136 - // import ('@/views/module/realQuestion'),  
137 - // meta: {  
138 - // title: '历年真题',  
139 - // icon: 'el-icon-s-management'  
140 - // }  
141 - // }]  
142 - // },  
143 -  
144 - {  
145 - path: '/views',  
146 - component: Layout,  
147 - redirect: '/views/TestPaper',  
148 - name: 'TestPaper',  
149 - meta: {  
150 - title: '试卷管理',  
151 - icon: 'el-icon-s-help'  
152 - },  
153 - children: [{  
154 - path: 'TestPaperList',  
155 - name: 'Table',  
156 - component: () =>  
157 - import ('@/views/TestPaper/TestPaperList'),  
158 - meta: {  
159 - title: '试卷列表',  
160 - icon: 'table'  
161 - }  
162 - },  
163 - {  
164 - path: 'index',  
165 - name: 'index',  
166 - component: () =>  
167 - import ('@/views/TestPaper/index'),  
168 - hidden: true,  
169 - meta: {  
170 - title: '试卷维护',  
171 - icon: 'table'  
172 - }  
173 - },  
174 - {  
175 - path: 'ManualTestPaper',  
176 - name: 'Table',  
177 - component: () =>  
178 - import ('@/views/TestPaper/ManualTestPaper'),  
179 - meta: {  
180 - title: '组卷',  
181 - icon: 'table'  
182 - }  
183 - },  
184 -  
185 - <<  
186 - << << < HEAD  
187 - ]  
188 - },  
189 - // {  
190 - // path: '/order',  
191 - // component: Layout,  
192 - // redirect: '/',  
193 - // name: 'order',  
194 - // meta: {  
195 - // title: '订单管理',  
196 - // icon: 'el-icon-s-marketing'  
197 - // },  
198 - // children: [{  
199 - // path: 'recharge',  
200 - // name: 'recharge',  
201 - // component: () =>  
202 - // import('@/views/order/rechargeList'),  
203 - // meta: {  
204 - // title: '充值记录',  
205 - // }  
206 - // }, {  
207 - // path: 'shop',  
208 - // name: 'shop',  
209 - // component: () =>  
210 - // import('@/views/order/shopList'),  
211 - // meta: {  
212 - // title: '购买记录',  
213 - // }  
214 - // }]  
215 - // },  
216 - {  
217 - path: '/user',  
218 - component: Layout,  
219 - redirect: '/',  
220 - name: 'user',  
221 - ===  
222 - === = {  
223 - code: 'example',  
224 - path: '/example',  
225 - component: Layout,  
226 - redirect: '/example/table',  
227 - name: 'Example',  
228 - meta: {  
229 - title: '题库管理',  
230 - icon: 'el-icon-s-help',  
231 - permissions: ['admin']  
232 - },  
233 - children: [{  
234 - code: '题库',  
235 - path: 'QuestionBank',  
236 - name: 'Table',  
237 - component: () =>  
238 - import ('@/views/QuestionBank/index'),  
239 - >>>  
240 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
241 - meta: {  
242 - title: '用户管理',  
243 - icon: 'el-icon-s-help'  
244 - },  
245 - children: [{  
246 - path: 'user',  
247 - name: 'User',  
248 - component: () =>  
249 - import ('@/views/user/userlist'),  
250 - meta: {  
251 - title: '人才库',  
252 - }  
253 - },  
254 - {  
255 - path: 'interviewSchedule',  
256 - name: 'interviewSchedule',  
257 - component: () =>  
258 - import ('@/views/user/InterviewSchedule'),  
259 - meta: {  
260 - title: '面试时间表',  
261 - }  
262 - },  
263 -  
264 - <<  
265 - << << < HEAD {  
266 - path: 'importuser',  
267 - name: 'importuser',  
268 -  
269 - component: () =>  
270 - import ('@/views/user/picuserimport'),  
271 - meta: {  
272 - title: '图片导入用户',  
273 - }  
274 - },  
275 - {  
276 - path: 'admin',  
277 - name: 'admin',  
278 - component: () =>  
279 - import ('@/views/user/adminList'),  
280 - meta: {  
281 - title: '管理员列表',  
282 - permissions: ['admin']  
283 - }  
284 - },  
285 -  
286 - ]  
287 - }, {  
288 - path: '/password',  
289 - component: Layout,  
290 - redirect: '/',  
291 - name: 'password',  
292 - ===  
293 - === = {  
294 - code: '试卷管理',  
295 - path: '/views',  
296 - component: Layout,  
297 - redirect: '/views/TestPaper',  
298 - name: 'TestPaper',  
299 - meta: {  
300 - title: '试卷管理',  
301 - icon: 'el-icon-s-help'  
302 - },  
303 - children: [{  
304 - code: '试卷列表',  
305 - path: 'TestPaperList',  
306 - name: 'Table',  
307 - component: () =>  
308 - import ('@/views/TestPaper/TestPaperList'),  
309 - >>>  
310 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
311 - meta: {  
312 - title: '系统管理',  
313 - icon: 'el-icon-s-platform'  
314 - },  
315 - children: [{  
316 - path: 'userdimset',  
317 - name: 'impouserdimsetrtuser',  
318 -  
319 - component: () =>  
320 - import ('@/views/user/userdimset'),  
321 - meta: {  
322 - title: '维度规则设置',  
323 - permissions: ['admin']  
324 - }  
325 - },  
326 - {  
327 - path: 'index',  
328 - name: 'index',  
329 - component: () =>  
330 - import ('@/views/password/index'),  
331 - meta: {  
332 - title: '忘记密码',  
333 - }  
334 - }, {  
335 - path: 'TestPaperClass',  
336 - name: 'Table',  
337 - component: () =>  
338 - import ('@/views/TestPaper/TestPaperClass'),  
339 - meta: {  
340 - title: '分类管理',  
341 - permissions: ['admin']  
342 - }  
343 - }, {  
344 - path: 'carousel',  
345 - name: 'carousel',  
346 - component: () =>  
347 - import ('@/views/carousel/index'),  
348 - meta: {  
349 - title: '轮播图',  
350 - permissions: ['admin']  
351 - }  
352 - }, {  
353 - path: 'new',  
354 - name: 'new',  
355 - component: () =>  
356 - import ('@/views/carousel/new'),  
357 - meta: {  
358 - title: '最新资讯',  
359 - permissions: ['admin']  
360 - }  
361 - }  
362 - ]  
363 - },  
364 - // 404 page must be placed at the end !!!  
365 - {  
366 - path: '*',  
367 - redirect: '/404',  
368 - hidden: true  
369 - }  
370 - ]  
371 - }  
372 - else {  
373 - return;  
374 - constantRoutes1 = [{  
375 - path: '/login',  
376 - component: () =>  
377 - import ('@/views/login/index'),  
378 - hidden: true  
379 - },  
380 -  
381 - { <<  
382 - << << < HEAD  
383 - path: '/404',  
384 - ===  
385 - === =  
386 - code: '组卷',  
387 - path: 'ManualTestPaper',  
388 - name: 'Table',  
389 - >>>  
390 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
391 - component: () =>  
392 - import ('@/views/404'),  
393 - hidden: true  
394 - },  
395 -  
396 - <<  
397 - << << < HEAD {  
398 - path: '/example',  
399 - component: Layout,  
400 - redirect: '/example/table',  
401 - name: 'Example',  
402 - ===  
403 - === =  
404 - ]  
405 - },  
406 - // {  
407 - // path: '/order',  
408 - // component: Layout,  
409 - // redirect: '/',  
410 - // name: 'order',  
411 - // meta: {  
412 - // title: '订单管理',  
413 - // icon: 'el-icon-s-marketing'  
414 - // },  
415 - // children: [{  
416 - // path: 'recharge',  
417 - // name: 'recharge',  
418 - // component: () =>  
419 - // import('@/views/order/rechargeList'),  
420 - // meta: {  
421 - // title: '充值记录',  
422 - // }  
423 - // }, {  
424 - // path: 'shop',  
425 - // name: 'shop',  
426 - // component: () =>  
427 - // import('@/views/order/shopList'),  
428 - // meta: {  
429 - // title: '购买记录',  
430 - // }  
431 - // }]  
432 - // },  
433 - {  
434 - code: '用户管理',  
435 - path: '/user',  
436 - component: Layout,  
437 - redirect: '/',  
438 - name: 'user',  
439 - meta: {  
440 - title: '用户管理',  
441 - icon: 'el-icon-s-help'  
442 - },  
443 - children: [{  
444 - code: '人才库',  
445 - path: 'user',  
446 - name: 'User',  
447 - component: () =>  
448 - import ('@/views/user/userlist'),  
449 - >>>  
450 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
451 - meta: {  
452 - title: '题库管理',  
453 - icon: 'el-icon-s-help',  
454 - permissions: ["admin", "user"],  
455 - },  
456 - children: [{  
457 - path: 'QuestionBank',  
458 - name: 'Table',  
459 - component: () =>  
460 - import ('@/views/QuestionBank/index'),  
461 - meta: {  
462 - title: '题库',  
463 - icon: 'table'  
464 - }  
465 - }, ]  
466 - },  
467 - { <<  
468 - << << < HEAD  
469 - path: '/moduleIndex',  
470 - component: Layout,  
471 - redirect: '/module/index',  
472 - name: 'module',  
473 - ===  
474 - === =  
475 - code: '面试时间表',  
476 - path: 'interviewSchedule',  
477 - name: 'interviewSchedule',  
478 - component: () =>  
479 - import ('@/views/user/InterviewSchedule'),  
480 - >>>  
481 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
482 - meta: {  
483 - title: '面试题',  
484 - icon: 'el-icon-s-help'  
485 - },  
486 - children: [{  
487 - path: 'recharge',  
488 - name: 'recharge',  
489 - component: () =>  
490 - import ('@/views/module/index'),  
491 - meta: {  
492 - title: '面试题',  
493 - icon: 'el-icon-s-operation'  
494 - }  
495 - },  
496 - {  
497 - path: 'index',  
498 - name: 'index',  
499 - component: () =>  
500 - import ('@/views/TestPaper/index'),  
501 - hidden: true,  
502 - meta: {  
503 - title: '试卷维护',  
504 - icon: 'table'  
505 - }  
506 - },  
507 - ]  
508 - },  
509 - // {  
510 - // path: '/realQuestion',  
511 - // component: Layout,  
512 - // redirect: '/module/realQuestion',  
513 - // name: 'realQuestion',  
514 - // meta: {  
515 - // title: '历年真题',  
516 - // icon: 'el-icon-s-help'  
517 - // },  
518 - // children: [{  
519 - // path: 'recharge',  
520 - // name: 'recharge',  
521 - // component: () =>  
522 - // import ('@/views/module/realQuestion'),  
523 - // meta: {  
524 - // title: '历年真题',  
525 - // icon: 'el-icon-s-management'  
526 - // }  
527 - // }]  
528 - // },  
529 -  
530 - { <<  
531 - << << < HEAD  
532 - path: '/views',  
533 - component: Layout,  
534 - redirect: '/views/TestPaper',  
535 - name: 'TestPaper',  
536 - ===  
537 - === =  
538 - code: 'importuser',  
539 - path: 'importuser',  
540 - name: 'importuser',  
541 -  
542 - component: () =>  
543 - import ('@/views/user/picuserimport'),  
544 - >>>  
545 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
546 - meta: {  
547 - title: '试卷管理',  
548 - icon: 'el-icon-s-help'  
549 - },  
550 - children: [{  
551 - path: 'TestPaperList',  
552 - name: 'Table',  
553 - component: () =>  
554 - import ('@/views/TestPaper/TestPaperList'),  
555 - meta: {  
556 - title: '试卷列表',  
557 - icon: 'table'  
558 - }  
559 - },  
560 - {  
561 - path: 'index',  
562 - name: 'index',  
563 - component: () =>  
564 - import ('@/views/TestPaper/index'),  
565 - hidden: true,  
566 - meta: {  
567 - title: '试卷维护',  
568 - icon: 'table'  
569 - }  
570 - },  
571 - // {  
572 - // path: 'ManualTestPaper',  
573 - // name: 'Table',  
574 - // component: () => import('@/views/TestPaper/ManualTestPaper'),  
575 - // meta: {  
576 - // title: '组卷',  
577 - // icon: 'table'  
578 - // }  
579 - // },  
580 -  
581 - ]  
582 - },  
583 - // {  
584 - // path: '/order',  
585 - // component: Layout,  
586 - // redirect: '/',  
587 - // name: 'order',  
588 - // meta: {  
589 - // title: '订单管理',  
590 - // icon: 'el-icon-s-marketing'  
591 - // },  
592 - // children: [{  
593 - // path: 'recharge',  
594 - // name: 'recharge',  
595 - // component: () =>  
596 - // import('@/views/order/rechargeList'),  
597 - // meta: {  
598 - // title: '充值记录',  
599 - // }  
600 - // }, {  
601 - // path: 'shop',  
602 - // name: 'shop',  
603 - // component: () =>  
604 - // import('@/views/order/shopList'),  
605 - // meta: {  
606 - // title: '购买记录',  
607 - // }  
608 - // }]  
609 - // },  
610 - { <<  
611 - << << < HEAD  
612 - path: '/user',  
613 - component: Layout,  
614 - redirect: '/',  
615 - name: 'user',  
616 - meta: {  
617 - title: '用户管理',  
618 - icon: 'el-icon-s-help'  
619 - },  
620 - children: [{  
621 - path: 'user',  
622 - name: 'User',  
623 - component: () =>  
624 - import ('@/views/user/userlist'),  
625 - meta: {  
626 - title: '人才库',  
627 - } ===  
628 - === =  
629 - code: 'admin',  
630 - path: 'admin',  
631 - name: 'admin',  
632 - component: () =>  
633 - import ('@/views/user/adminList'),  
634 - meta: {  
635 - title: '管理员列表',  
636 - permissions: ['admin']  
637 - }  
638 - },  
639 -  
640 - ]  
641 - }, {  
642 - code: '系统管理',  
643 - path: '/system',  
644 - component: Layout,  
645 - redirect: '/',  
646 - name: 'password',  
647 - meta: {  
648 - title: '系统管理',  
649 - icon: 'el-icon-s-platform'  
650 - },  
651 - children: [{  
652 - code: 'userdimset',  
653 - path: 'userdimset',  
654 - name: 'impouserdimsetrtuser',  
655 -  
656 - component: () =>  
657 - import ('@/views/user/userdimset'),  
658 - meta: {  
659 - title: '维度规则设置',  
660 - permissions: ['admin'] >>>  
661 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
662 - }  
663 -  
664 - ]  
665 - },  
666 - {  
667 - path: '/password',  
668 - component: Layout,  
669 - redirect: '/',  
670 - name: 'password',  
671 - meta: {  
672 - title: '系统管理',  
673 - icon: 'el-icon-s-platform',  
674 - permissions: ['admin', 'user']  
675 - },  
676 - children: [{  
677 - path: 'index',  
678 - name: 'index',  
679 - component: () =>  
680 - import ('@/views/password/index'),  
681 - meta: {  
682 - title: '忘记密码',  
683 - }  
684 - },  
685 - {  
686 - code: 'settings',  
687 - path: 'settings',  
688 - name: 'settings',  
689 - component: () =>  
690 - import ('@/views/settings/index'),  
691 - meta: {  
692 - title: '系统设置',  
693 - }  
694 - },  
695 - {  
696 - code: 'TestPaperClass',  
697 - path: 'TestPaperClass',  
698 - name: 'Table',  
699 - component: () =>  
700 - import ('@/views/TestPaper/TestPaperClass'),  
701 - meta: {  
702 - title: '分类管理',  
703 - permissions: ['admin']  
704 - }  
705 - }, {  
706 - code: 'carousel',  
707 - path: 'carousel',  
708 - name: 'carousel',  
709 - component: () =>  
710 - import ('@/views/carousel/index'),  
711 - meta: {  
712 - title: '轮播图',  
713 - permissions: ['admin']  
714 - }  
715 - }, {  
716 - code: 'new',  
717 - path: 'new',  
718 - name: 'new',  
719 - component: () =>  
720 - import ('@/views/carousel/new'),  
721 - meta: {  
722 - title: '最新资讯',  
723 - permissions: ['admin']  
724 - } <<  
725 - << << < HEAD  
726 - }  
727 - ] ===  
728 - === =  
729 - },  
730 - {  
731 - code: 'rolelist',  
732 - path: 'role',  
733 - name: 'rolelist',  
734 - component: () =>  
735 - import ('@/views/user/rolelist'),  
736 - meta: {  
737 - title: '角色权限',  
738 - permissions: ['admin']  
739 - }  
740 - },  
741 - {  
742 - code: 'logs',  
743 - path: 'logs',  
744 - name: 'logs',  
745 -  
746 - component: () =>  
747 - import ('@/views/user/loglist'),  
748 - meta: {  
749 - title: '系统日志',  
750 - }  
751 - },  
752 -  
753 -  
754 - ]  
755 - },  
756 - // 404 page must be placed at the end !!!  
757 - {  
758 - path: '*',  
759 - redirect: '/404',  
760 - hidden: true  
761 - }  
762 - ]  
763 - } else {  
764 - return;  
765 - constantRoutes1 = [{  
766 - path: '/login',  
767 - component: () =>  
768 - import ('@/views/login/index'),  
769 - hidden: true  
770 - },  
771 -  
772 - {  
773 - path: '/404',  
774 - component: () =>  
775 - import ('@/views/404'),  
776 - hidden: true  
777 - },  
778 -  
779 - {  
780 - path: '/example',  
781 - component: Layout,  
782 - redirect: '/example/table',  
783 - name: 'Example',  
784 - meta: {  
785 - title: '题库管理',  
786 - icon: 'el-icon-s-help',  
787 - permissions: ["admin", "user"],  
788 - },  
789 - children: [{  
790 - path: 'QuestionBank',  
791 - name: 'Table',  
792 - component: () =>  
793 - import ('@/views/QuestionBank/index'),  
794 - meta: {  
795 - title: '题库',  
796 - icon: 'table'  
797 - }  
798 - }, ]  
799 - },  
800 - {  
801 - path: '/moduleIndex',  
802 - component: Layout,  
803 - redirect: '/module/index',  
804 - name: 'module',  
805 - meta: {  
806 - title: '面试题',  
807 - icon: 'el-icon-s-help'  
808 - },  
809 - children: [{  
810 - path: 'recharge',  
811 - name: 'recharge',  
812 - component: () =>  
813 - import ('@/views/module/index'),  
814 - meta: {  
815 - title: '面试题',  
816 - icon: 'el-icon-s-operation'  
817 - } >>>  
818 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
819 - },  
820 - // 404 page must be placed at the end !!!  
821 - {  
822 - path: '*',  
823 - redirect: '/404',  
824 - hidden: true  
825 - }  
826 - ]  
827 - }  
828 -  
829 -  
830 - function hasPermission(permissions, route) {  
831 - if (route.meta && route.meta.permissions) {  
832 - return permissions.some((role) => route.meta.permissions.includes(role));  
833 - } else {  
834 - return true;  
835 - }  
836 - } 171 + component: () =>
  172 + import ('@/views/user/userdimset'),
  173 + meta: {
  174 + title: '维度规则设置',
  175 + permissions: ['admin']
  176 + }
  177 + },
  178 + {
  179 + path: 'index',
  180 + name: 'index',
  181 + component: () =>
  182 + import ('@/views/password/index'),
  183 + meta: {
  184 + title: '忘记密码',
  185 + }
  186 + }, {
  187 + path: 'TestPaperClass',
  188 + name: 'Table',
  189 + component: () =>
  190 + import ('@/views/TestPaper/TestPaperClass'),
  191 + meta: {
  192 + title: '分类管理',
  193 + permissions: ['admin']
  194 + }
  195 + }, {
  196 + path: 'carousel',
  197 + name: 'carousel',
  198 + component: () =>
  199 + import ('@/views/carousel/index'),
  200 + meta: {
  201 + title: '轮播图',
  202 + permissions: ['admin']
  203 + }
  204 + }, {
  205 + path: 'new',
  206 + name: 'new',
  207 + component: () =>
  208 + import ('@/views/carousel/new'),
  209 + meta: {
  210 + title: '最新资讯',
  211 + permissions: ['admin']
  212 + }
  213 + }, {
  214 + code: 'rolelist',
  215 + path: 'role',
  216 + name: 'rolelist',
  217 + component: () =>
  218 + import ('@/views/user/rolelist'),
  219 + meta: {
  220 + title: '角色权限',
  221 + permissions: ['admin']
  222 + }
  223 + },
  224 + {
  225 + code: 'logs',
  226 + path: 'logs',
  227 + name: 'logs',
837 228
  229 + component: () =>
  230 + import ('@/views/user/loglist'),
  231 + meta: {
  232 + title: '系统日志',
  233 + }
  234 + },
  235 + ]
  236 + },
  237 + // 404 page must be placed at the end !!!
  238 + {
  239 + path: '*',
  240 + redirect: '/404',
  241 + hidden: true
  242 + }
  243 + ]
  244 + } else {
  245 + constantRoutes1 = [{
  246 + path: '/login',
  247 + component: () =>
  248 + import ('@/views/login/index'),
  249 + hidden: true
  250 + },
  251 +
  252 + {
  253 + path: '/404',
  254 + component: () =>
  255 + import ('@/views/404'),
  256 + hidden: true
  257 + },
  258 + {
  259 + path: '/answerDetail',
  260 + name: '答题详情',
  261 + component: () =>
  262 + import ('@/views/AnswerResult/detail.vue'),
  263 + hidden: true
  264 + },
  265 + {
  266 + path: '/',
  267 + component: Layout,
  268 + redirect: '/dashboard',
  269 + children: [{
  270 + path: 'dashboard',
  271 + name: '首页',
  272 + component: () =>
  273 + import ('@/views/dashboard/index'),
  274 + meta: {
  275 + title: '首页',
  276 + icon: 'dashboard'
  277 + }
  278 + }]
  279 + },
  280 +
  281 + // {
  282 + // path: '/example',
  283 + // component: Layout,
  284 + // redirect: '/example/table',
  285 + // name: 'Example',
  286 + // meta: {
  287 + // title: '题库管理',
  288 + // icon: 'el-icon-s-help'
  289 + // },
  290 + // children: [{
  291 + // path: 'QuestionBank',
  292 + // name: 'Table',
  293 + // component: () => import('@/views/QuestionBank/index'),
  294 + // meta: {
  295 + // title: '题库',
  296 + // icon: 'table'
  297 + // }
  298 + // }]
  299 + // },
  300 + {
  301 + path: '/moduleIndex',
  302 + component: Layout,
  303 + redirect: '/module/index',
  304 + name: 'module',
  305 + meta: {
  306 + title: '练习',
  307 + icon: 'el-icon-s-help'
  308 + },
  309 + children: [{
  310 + path: 'recharge',
  311 + name: 'recharge',
  312 + component: () =>
  313 + import ('@/views/module/index'),
  314 + meta: {
  315 + title: '练习',
  316 + icon: 'el-icon-s-operation'
  317 + }
  318 + },
  319 + {
  320 + path: 'index',
  321 + name: 'index',
  322 + component: () =>
  323 + import ('@/views/TestPaper/index'),
  324 + hidden: true,
  325 + meta: {
  326 + title: '试卷维护',
  327 + icon: 'table'
  328 + }
  329 + },
  330 + ]
  331 + },
  332 + {
  333 + path: '/realQuestion',
  334 + component: Layout,
  335 + redirect: '/module/realQuestion',
  336 + name: 'realQuestion',
  337 + meta: {
  338 + title: '历年真题',
  339 + icon: 'el-icon-s-help'
  340 + },
  341 + children: [{
  342 + path: 'recharge',
  343 + name: 'recharge',
  344 + component: () =>
  345 + import ('@/views/module/realQuestion'),
  346 + meta: {
  347 + title: '历年真题',
  348 + icon: 'el-icon-s-management'
  349 + }
  350 + }]
  351 + },
  352 + {
  353 + path: '/simulation',
  354 + component: Layout,
  355 + redirect: '/module/simulation',
  356 + name: 'module',
  357 + meta: {
  358 + title: '模拟试卷',
  359 + icon: 'el-icon-s-help'
  360 + },
  361 + children: [{
  362 + path: 'recharge',
  363 + name: 'recharge',
  364 + component: () =>
  365 + import ('@/views/module/simulation'),
  366 + meta: {
  367 + title: '模拟试卷',
  368 + icon: 'el-icon-s-promotion'
  369 + }
  370 + }]
  371 + },
  372 +
  373 + // {
  374 + // path: '/views',
  375 + // component: Layout,
  376 + // redirect: '/views/TestPaper',
  377 + // name: 'TestPaper',
  378 + // meta: {
  379 + // title: '试卷管理',
  380 + // icon: 'el-icon-s-help'
  381 + // },
  382 + // children: [
  383 + // {
  384 + // path: 'TestPaperList',
  385 + // name: 'Table',
  386 + // component: () => import('@/views/TestPaper/TestPaperList'),
  387 + // meta: {
  388 + // title: '试卷列表',
  389 + // icon: 'table'
  390 + // }
  391 + // },
  392 + // {
  393 + // path: 'index',
  394 + // name: 'index',
  395 + // component: () => import('@/views/TestPaper/index'),
  396 + // hidden: true,
  397 + // meta: {
  398 + // title: '试卷维护',
  399 + // icon: 'table'
  400 + // }
  401 + // },
  402 + // // {
  403 + // // path: 'ManualTestPaper',
  404 + // // name: 'Table',
  405 + // // component: () => import('@/views/TestPaper/ManualTestPaper'),
  406 + // // meta: {
  407 + // // title: '组卷',
  408 + // // icon: 'table'
  409 + // // }
  410 + // // },
  411 +
  412 + // ]
  413 + // },
  414 + {
  415 + path: '/order',
  416 + component: Layout,
  417 + redirect: '/',
  418 + name: 'order',
  419 + meta: {
  420 + title: '订单管理',
  421 + icon: 'el-icon-s-marketing'
  422 + },
  423 + children: [{
  424 + path: 'recharge',
  425 + name: 'recharge',
  426 + component: () =>
  427 + import ('@/views/order/rechargeList'),
  428 + meta: {
  429 + title: '充值记录',
  430 + }
  431 + }, {
  432 + path: 'shop',
  433 + name: 'shop',
  434 + component: () =>
  435 + import ('@/views/order/shopList'),
  436 + meta: {
  437 + title: '购买记录',
  438 + }
  439 + }]
  440 + },
  441 + {
  442 + path: '/user',
  443 + component: Layout,
  444 + redirect: '/',
  445 + name: 'user',
  446 + meta: {
  447 + title: '用户管理',
  448 + icon: 'el-icon-s-help'
  449 + },
  450 + children: [{
  451 + path: 'user',
  452 + name: 'User',
  453 + component: () =>
  454 + import ('@/views/user/userlist'),
  455 + meta: {
  456 + title: '普通用户列表',
  457 + }
  458 + },
  459 +
  460 +
  461 + ]
  462 + }, {
  463 + path: '/password',
  464 + component: Layout,
  465 + redirect: '/',
  466 + name: 'password',
  467 + meta: {
  468 + title: '系统管理',
  469 + icon: 'el-icon-s-platform'
  470 + },
  471 + children: [{
  472 + path: 'index',
  473 + name: 'index',
  474 + component: () =>
  475 + import ('@/views/password/index'),
  476 + meta: {
  477 + title: '忘记密码',
  478 + }
  479 + }, {
  480 + path: 'TestPaperClass',
  481 + name: 'Table',
  482 + component: () =>
  483 + import ('@/views/TestPaper/TestPaperClass'),
  484 + meta: {
  485 + title: '分类管理',
  486 + }
  487 + }, {
  488 + path: 'carousel',
  489 + name: 'carousel',
  490 + component: () =>
  491 + import ('@/views/carousel/index'),
  492 + meta: {
  493 + title: '轮播图',
  494 + }
  495 + }, {
  496 + path: 'new',
  497 + name: 'new',
  498 + component: () =>
  499 + import ('@/views/carousel/new'),
  500 + meta: {
  501 + title: '最新资讯',
  502 + }
  503 + }]
  504 + },
  505 + // 404 page must be placed at the end !!!
  506 + {
  507 + path: '*',
  508 + redirect: '/404',
  509 + hidden: true
  510 + }
  511 + ]
  512 + }
838 513
839 - function filterAsyncRoutes(routes, permissions) {  
840 - const finallyRoutes = [];  
841 - routes.forEach((route) => { <<  
842 - << << < HEAD  
843 - const item = {...route };  
844 - if (hasPermission(permissions, item)) { ===  
845 - === =  
846 - const item = {...route };  
847 - // if (hasPermission(permissions, item)) {  
848 - if (permissions.includes(item.code) || !item.code) { >>>  
849 - >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74  
850 - if (item.children) {  
851 - item.children = filterAsyncRoutes(item.children, permissions);  
852 - }  
853 - finallyRoutes.push(item);  
854 - }  
855 - });  
856 - return finallyRoutes;  
857 - }  
858 - constantRoutes1 = filterAsyncRoutes(constantRoutes1, permissions);  
859 514
860 - return constantRoutes1;  
861 - }  
862 \ No newline at end of file 515 \ No newline at end of file
  516 + return constantRoutes1;
  517 +}
863 \ No newline at end of file 518 \ No newline at end of file
src/views/AnswerResult/detail.vue
@@ -19,7 +19,8 @@ @@ -19,7 +19,8 @@
19 }}</el-tag> 19 }}</el-tag>
20 【{{ item.subjectName }}】{{ item.subject }} 20 【{{ item.subjectName }}】{{ item.subject }}
21 </h4> 21 </h4>
22 - <div v-if="item.subjectType == 4"> 22 + <div v-if="item.subjectType == 4 || item.subjectType == 3">
  23 + <p>{{ item.answer }}</p>
23 <audio controls> 24 <audio controls>
24 <source :src="BASE_URL + item.answer" /> 25 <source :src="BASE_URL + item.answer" />
25 </audio> 26 </audio>