Commit d6d8312085c4fb49c8af7e33c1db7c39c13c8599

Authored by 周超
2 parents a7974ab3 63deedae

222

beifen20221105.zip 0 → 100644
No preview for this file type
src/utils/routerList.js
1 1 import Layout from '@/layout'
2 2 import { getInfo } from '../store/modules/user.js'
3   -import {GetMenueRole} from '@/api/role'
  3 +import { GetMenueRole } from '@/api/role'
4 4  
5   -export function getRoutes(permissions) {
  5 +export function getRoutes(permissions) {
6 6 let userInfo = {}
7 7 if (localStorage.userinfo) {
8 8 userInfo = JSON.parse(localStorage.userinfo)
9 9 }
10 10 var permissions = userInfo.permissions || [];
11   -
12   -// var roles = await GetMenueRole();
13   -// roles = roles.data.map(o=>o.code);
14   -
  11 +
  12 + // var roles = await GetMenueRole();
  13 + // roles = roles.data.map(o=>o.code);
  14 +
15 15 let constantRoutes1 = []
16 16 if (true) {
17 17 constantRoutes1 = [{
  18 +<<<<<<< HEAD
18 19 path: '/login',
19 20 component: () =>
20 21 import('@/views/login/index'),
... ... @@ -274,356 +275,849 @@ export function getRoutes(permissions) {
274 275 path: 'userdimset',
275 276 name: 'impouserdimsetrtuser',
276 277  
  278 +=======
  279 + path: '/login',
  280 +>>>>>>> 63deedae0dfc58ee6126449e91cbb703657842a0
277 281 component: () =>
278   - import('@/views/user/userdimset'),
279   - meta: {
280   - title: '维度规则设置',
281   - permissions:['admin' ]
282   - }
  282 + import ('@/views/login/index'),
  283 + hidden: true
283 284 },
  285 +
284 286 {
285   - path: 'index',
286   - name: 'index',
  287 + path: '/404',
287 288 component: () =>
288   - import('@/views/password/index'),
289   - meta: {
290   - title: '忘记密码',
291   - }
  289 + import ('@/views/404'),
  290 + hidden: true
292 291 },
  292 +
293 293 {
294   - code:'settings',
295   - path: 'settings',
296   - name: 'settings',
  294 + path: '/answerDetail',
  295 + name: '答题详情',
297 296 component: () =>
298   - import('@/views/settings/index'),
299   - meta: {
300   - title: '系统设置',
301   - }
  297 + import ('@/views/AnswerResult/detail.vue'),
  298 + hidden: true
302 299 },
303   - {
304   - code:'TestPaperClass',
305   - path: 'TestPaperClass',
306   - name: 'Table',
307   - component: () =>
308   - import('@/views/TestPaper/TestPaperClass'),
309   - meta: {
310   - title: '分类管理',
311   - permissions:['admin' ]
312   - }
313   - }, {
314   - code: 'carousel',
315   - path: 'carousel',
316   - name: 'carousel',
317   - component: () =>
318   - import('@/views/carousel/index'),
319   - meta: {
320   - title: '轮播图',
321   - permissions:['admin' ]
322   - }
323   - }, {
324   - code: 'new',
325   - path: 'new',
326   - name: 'new',
327   - component: () =>
328   - import('@/views/carousel/new'),
329   - meta: {
330   - title: '最新资讯',
331   - permissions:['admin']
332   - }
333   - }
334   - , {
335   - code: 'rolelist',
336   - path: 'role',
337   - name: 'rolelist',
338   - component: () =>
339   - import('@/views/user/rolelist'),
340   - meta: {
341   - title: '角色权限',
342   - permissions:['admin']
343   - }
  300 +
  301 +
  302 + <<
  303 + << << < HEAD {
  304 + path: '/',
  305 + component: Layout,
  306 + redirect: '/dashboard',
  307 + children: [{
  308 + path: 'dashboard',
  309 + name: '首页',
  310 + component: () =>
  311 + import ('@/views/dashboard/index'),
  312 + meta: {
  313 + title: '首页',
  314 + icon: 'dashboard'
  315 + }
  316 + }, {
  317 + path: 'live',
  318 + name: '直播观看',
  319 + component: () =>
  320 + import ('@/views/live/index'),
  321 + meta: {
  322 + title: '直播',
  323 + icon: 'video'
  324 + },
  325 + hidden: true
  326 + }]
344 327 },
  328 +
345 329 {
346   - code:'logs',
347   - path: 'logs',
348   - name: 'logs',
349   -
350   - component: () =>
351   - import('@/views/user/loglist'),
352   - meta: {
353   - title: '系统日志',
354   - }
355   - },
  330 + path: '/example',
  331 + component: Layout,
  332 + redirect: '/example/table',
  333 + name: 'Example',
  334 + ===
  335 + === = {
  336 + code: 'home',
  337 + path: '/',
  338 + component: Layout,
  339 + redirect: '/dashboard',
  340 + children: [{
  341 + path: 'dashboard',
  342 + name: '首页',
  343 + component: () =>
  344 + import ('@/views/dashboard/index'),
  345 + >>>
  346 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  347 + meta: {
  348 + title: '题库管理',
  349 + icon: 'el-icon-s-help',
  350 + permissions: ['admin']
  351 + },
  352 + children: [{
  353 + path: 'QuestionBank',
  354 + name: 'Table',
  355 + component: () =>
  356 + import ('@/views/QuestionBank/index'),
  357 + meta: {
  358 + title: '题库',
  359 + icon: 'table',
  360 + permissions: ['admin']
  361 + }
  362 + }, ]
  363 + },
  364 + // {
  365 + // path: '/moduleIndex',
  366 + // component: Layout,
  367 + // redirect: '/module/index',
  368 + // name: 'module',
  369 + // meta: {
  370 + // title: '面试题',
  371 + // icon: 'el-icon-s-help'
  372 + // },
  373 + // children: [{
  374 + // path: 'index',
  375 + // name: 'index',
  376 + // component: () =>
  377 + // import ('@/views/TestPaper/index'),
  378 + // hidden: true,
  379 + // meta: {
  380 + // title: '试卷维护',
  381 + // icon: 'table'
  382 + // }
  383 + // }, ]
  384 + // },
  385 + // {
  386 + // path: '/realQuestion',
  387 + // component: Layout,
  388 + // redirect: '/module/realQuestion',
  389 + // name: 'realQuestion',
  390 + // meta: {
  391 + // title: '历年真题',
  392 + // icon: 'el-icon-s-help'
  393 + // },
  394 + // children: [{
  395 + // path: 'recharge',
  396 + // name: 'recharge',
  397 + // component: () =>
  398 + // import ('@/views/module/realQuestion'),
  399 + // meta: {
  400 + // title: '历年真题',
  401 + // icon: 'el-icon-s-management'
  402 + // }
  403 + // }]
  404 + // },
356 405  
  406 + {
  407 + path: '/views',
  408 + component: Layout,
  409 + redirect: '/views/TestPaper',
  410 + name: 'TestPaper',
  411 + meta: {
  412 + title: '试卷管理',
  413 + icon: 'el-icon-s-help'
  414 + },
  415 + children: [{
  416 + path: 'TestPaperList',
  417 + name: 'Table',
  418 + component: () =>
  419 + import ('@/views/TestPaper/TestPaperList'),
  420 + meta: {
  421 + title: '试卷列表',
  422 + icon: 'table'
  423 + }
  424 + },
  425 + {
  426 + path: 'index',
  427 + name: 'index',
  428 + component: () =>
  429 + import ('@/views/TestPaper/index'),
  430 + hidden: true,
  431 + meta: {
  432 + title: '试卷维护',
  433 + icon: 'table'
  434 + }
  435 + },
  436 + {
  437 + path: 'ManualTestPaper',
  438 + name: 'Table',
  439 + component: () =>
  440 + import ('@/views/TestPaper/ManualTestPaper'),
  441 + meta: {
  442 + title: '组卷',
  443 + icon: 'table'
  444 + }
  445 + },
357 446  
358   - ]
359   - },
360   - // 404 page must be placed at the end !!!
361   - {
362   - path: '*',
363   - redirect: '/404',
364   - hidden: true
365   - }
366   - ]
367   - } else {
368   - return ;
369   - constantRoutes1 = [{
370   - path: '/login',
371   - component: () =>
372   - import('@/views/login/index'),
373   - hidden: true
374   - },
  447 + <<
  448 + << << < HEAD
  449 + ]
  450 + },
  451 + // {
  452 + // path: '/order',
  453 + // component: Layout,
  454 + // redirect: '/',
  455 + // name: 'order',
  456 + // meta: {
  457 + // title: '订单管理',
  458 + // icon: 'el-icon-s-marketing'
  459 + // },
  460 + // children: [{
  461 + // path: 'recharge',
  462 + // name: 'recharge',
  463 + // component: () =>
  464 + // import('@/views/order/rechargeList'),
  465 + // meta: {
  466 + // title: '充值记录',
  467 + // }
  468 + // }, {
  469 + // path: 'shop',
  470 + // name: 'shop',
  471 + // component: () =>
  472 + // import('@/views/order/shopList'),
  473 + // meta: {
  474 + // title: '购买记录',
  475 + // }
  476 + // }]
  477 + // },
  478 + {
  479 + path: '/user',
  480 + component: Layout,
  481 + redirect: '/',
  482 + name: 'user',
  483 + ===
  484 + === = {
  485 + code: 'example',
  486 + path: '/example',
  487 + component: Layout,
  488 + redirect: '/example/table',
  489 + name: 'Example',
  490 + meta: {
  491 + title: '题库管理',
  492 + icon: 'el-icon-s-help',
  493 + permissions: ['admin']
  494 + },
  495 + children: [{
  496 + code: '题库',
  497 + path: 'QuestionBank',
  498 + name: 'Table',
  499 + component: () =>
  500 + import ('@/views/QuestionBank/index'),
  501 + >>>
  502 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  503 + meta: {
  504 + title: '用户管理',
  505 + icon: 'el-icon-s-help'
  506 + },
  507 + children: [{
  508 + path: 'user',
  509 + name: 'User',
  510 + component: () =>
  511 + import ('@/views/user/userlist'),
  512 + meta: {
  513 + title: '人才库',
  514 + }
  515 + },
  516 + {
  517 + path: 'interviewSchedule',
  518 + name: 'interviewSchedule',
  519 + component: () =>
  520 + import ('@/views/user/InterviewSchedule'),
  521 + meta: {
  522 + title: '面试时间表',
  523 + }
  524 + },
375 525  
376   - {
377   - path: '/404',
378   - component: () =>
379   - import('@/views/404'),
380   - hidden: true
381   - },
  526 + <<
  527 + << << < HEAD {
  528 + path: 'importuser',
  529 + name: 'importuser',
382 530  
383   - {
384   - path: '/example',
385   - component: Layout,
386   - redirect: '/example/table',
387   - name: 'Example',
388   - meta: {
389   - title: '题库管理',
390   - icon: 'el-icon-s-help',
391   - permissions: ["admin", "user"],
392   - },
393   - children: [{
394   - path: 'QuestionBank',
395   - name: 'Table',
396   - component: () =>
397   - import('@/views/QuestionBank/index'),
398   - meta: {
399   - title: '题库',
400   - icon: 'table'
401   - }
402   - },]
403   - },
404   - {
405   - path: '/moduleIndex',
406   - component: Layout,
407   - redirect: '/module/index',
408   - name: 'module',
409   - meta: {
410   - title: '面试题',
411   - icon: 'el-icon-s-help'
412   - },
413   - children: [{
414   - path: 'recharge',
415   - name: 'recharge',
416   - component: () =>
417   - import('@/views/module/index'),
418   - meta: {
419   - title: '面试题',
420   - icon: 'el-icon-s-operation'
421   - }
422   - },
423   - {
424   - path: 'index',
425   - name: 'index',
426   - component: () =>
427   - import('@/views/TestPaper/index'),
428   - hidden: true,
429   - meta: {
430   - title: '试卷维护',
431   - icon: 'table'
432   - }
433   - },
434   - ]
435   - },
436   - // {
437   - // path: '/realQuestion',
438   - // component: Layout,
439   - // redirect: '/module/realQuestion',
440   - // name: 'realQuestion',
441   - // meta: {
442   - // title: '历年真题',
443   - // icon: 'el-icon-s-help'
444   - // },
445   - // children: [{
446   - // path: 'recharge',
447   - // name: 'recharge',
448   - // component: () =>
449   - // import ('@/views/module/realQuestion'),
450   - // meta: {
451   - // title: '历年真题',
452   - // icon: 'el-icon-s-management'
453   - // }
454   - // }]
455   - // },
  531 + component: () =>
  532 + import ('@/views/user/picuserimport'),
  533 + meta: {
  534 + title: '图片导入用户',
  535 + }
  536 + },
  537 + {
  538 + path: 'admin',
  539 + name: 'admin',
  540 + component: () =>
  541 + import ('@/views/user/adminList'),
  542 + meta: {
  543 + title: '管理员列表',
  544 + permissions: ['admin']
  545 + }
  546 + },
456 547  
457   - {
458   - path: '/views',
459   - component: Layout,
460   - redirect: '/views/TestPaper',
461   - name: 'TestPaper',
462   - meta: {
463   - title: '试卷管理',
464   - icon: 'el-icon-s-help'
465   - },
466   - children: [{
467   - path: 'TestPaperList',
468   - name: 'Table',
469   - component: () =>
470   - import('@/views/TestPaper/TestPaperList'),
471   - meta: {
472   - title: '试卷列表',
473   - icon: 'table'
474   - }
475   - },
476   - {
477   - path: 'index',
478   - name: 'index',
479   - component: () =>
480   - import('@/views/TestPaper/index'),
481   - hidden: true,
482   - meta: {
483   - title: '试卷维护',
484   - icon: 'table'
485   - }
486   - },
487   - // {
488   - // path: 'ManualTestPaper',
489   - // name: 'Table',
490   - // component: () => import('@/views/TestPaper/ManualTestPaper'),
491   - // meta: {
492   - // title: '组卷',
493   - // icon: 'table'
494   - // }
495   - // },
  548 + ]
  549 + }, {
  550 + path: '/password',
  551 + component: Layout,
  552 + redirect: '/',
  553 + name: 'password',
  554 + ===
  555 + === = {
  556 + code: '试卷管理',
  557 + path: '/views',
  558 + component: Layout,
  559 + redirect: '/views/TestPaper',
  560 + name: 'TestPaper',
  561 + meta: {
  562 + title: '试卷管理',
  563 + icon: 'el-icon-s-help'
  564 + },
  565 + children: [{
  566 + code: '试卷列表',
  567 + path: 'TestPaperList',
  568 + name: 'Table',
  569 + component: () =>
  570 + import ('@/views/TestPaper/TestPaperList'),
  571 + >>>
  572 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  573 + meta: {
  574 + title: '系统管理',
  575 + icon: 'el-icon-s-platform'
  576 + },
  577 + children: [{
  578 + path: 'userdimset',
  579 + name: 'impouserdimsetrtuser',
496 580  
497   - ]
498   - },
499   - // {
500   - // path: '/order',
501   - // component: Layout,
502   - // redirect: '/',
503   - // name: 'order',
504   - // meta: {
505   - // title: '订单管理',
506   - // icon: 'el-icon-s-marketing'
507   - // },
508   - // children: [{
509   - // path: 'recharge',
510   - // name: 'recharge',
511   - // component: () =>
512   - // import('@/views/order/rechargeList'),
513   - // meta: {
514   - // title: '充值记录',
515   - // }
516   - // }, {
517   - // path: 'shop',
518   - // name: 'shop',
519   - // component: () =>
520   - // import('@/views/order/shopList'),
521   - // meta: {
522   - // title: '购买记录',
523   - // }
524   - // }]
525   - // },
526   - {
527   - path: '/user',
528   - component: Layout,
529   - redirect: '/',
530   - name: 'user',
531   - meta: {
532   - title: '用户管理',
533   - icon: 'el-icon-s-help'
534   - },
535   - children: [{
536   - path: 'user',
537   - name: 'User',
538   - component: () =>
539   - import('@/views/user/userlist'),
540   - meta: {
541   - title: '人才库',
542   - }
543   - }
  581 + component: () =>
  582 + import ('@/views/user/userdimset'),
  583 + meta: {
  584 + title: '维度规则设置',
  585 + permissions: ['admin']
  586 + }
  587 + },
  588 + {
  589 + path: 'index',
  590 + name: 'index',
  591 + component: () =>
  592 + import ('@/views/password/index'),
  593 + meta: {
  594 + title: '忘记密码',
  595 + }
  596 + }, {
  597 + path: 'TestPaperClass',
  598 + name: 'Table',
  599 + component: () =>
  600 + import ('@/views/TestPaper/TestPaperClass'),
  601 + meta: {
  602 + title: '分类管理',
  603 + permissions: ['admin']
  604 + }
  605 + }, {
  606 + path: 'carousel',
  607 + name: 'carousel',
  608 + component: () =>
  609 + import ('@/views/carousel/index'),
  610 + meta: {
  611 + title: '轮播图',
  612 + permissions: ['admin']
  613 + }
  614 + }, {
  615 + path: 'new',
  616 + name: 'new',
  617 + component: () =>
  618 + import ('@/views/carousel/new'),
  619 + meta: {
  620 + title: '最新资讯',
  621 + permissions: ['admin']
  622 + }
  623 + }
  624 + ]
  625 + },
  626 + // 404 page must be placed at the end !!!
  627 + {
  628 + path: '*',
  629 + redirect: '/404',
  630 + hidden: true
  631 + }
  632 + ]
  633 + }
  634 + else {
  635 + return;
  636 + constantRoutes1 = [{
  637 + path: '/login',
  638 + component: () =>
  639 + import ('@/views/login/index'),
  640 + hidden: true
  641 + },
544 642  
545   - ]
546   - }, {
547   - path: '/password',
548   - component: Layout,
549   - redirect: '/',
550   - name: 'password',
551   - meta: {
552   - title: '系统管理',
553   - icon: 'el-icon-s-platform',
554   - permissions:['admin','user']
555   - },
556   - children: [{
557   - path: 'index',
558   - name: 'index',
559   - component: () =>
560   - import('@/views/password/index'),
561   - meta: {
562   - title: '忘记密码',
563   - }
564   - }, {
565   - path: 'TestPaperClass',
566   - name: 'Table',
567   - component: () =>
568   - import('@/views/TestPaper/TestPaperClass'),
569   - meta: {
570   - title: '分类管理',
571   - permissions: ['admin']
572   - }
573   - }, {
574   - path: 'carousel',
575   - name: 'carousel',
576   - component: () =>
577   - import('@/views/carousel/index'),
578   - meta: {
579   - title: '轮播图',
580   - permissions: ['admin']
581   - }
582   - }, {
583   - path: 'new',
584   - name: 'new',
585   - component: () =>
586   - import('@/views/carousel/new'),
587   - meta: {
588   - title: '最新资讯',
589   - permissions: ['admin']
590   - }
591   - }]
592   - },
593   - // 404 page must be placed at the end !!!
594   - {
595   - path: '*',
596   - redirect: '/404',
597   - hidden: true
598   - }
599   - ]
600   - }
  643 + { <<
  644 + << << < HEAD
  645 + path: '/404',
  646 + ===
  647 + === =
  648 + code: '组卷',
  649 + path: 'ManualTestPaper',
  650 + name: 'Table',
  651 + >>>
  652 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  653 + component: () =>
  654 + import ('@/views/404'),
  655 + hidden: true
  656 + },
601 657  
  658 + <<
  659 + << << < HEAD {
  660 + path: '/example',
  661 + component: Layout,
  662 + redirect: '/example/table',
  663 + name: 'Example',
  664 + ===
  665 + === =
  666 + ]
  667 + },
  668 + // {
  669 + // path: '/order',
  670 + // component: Layout,
  671 + // redirect: '/',
  672 + // name: 'order',
  673 + // meta: {
  674 + // title: '订单管理',
  675 + // icon: 'el-icon-s-marketing'
  676 + // },
  677 + // children: [{
  678 + // path: 'recharge',
  679 + // name: 'recharge',
  680 + // component: () =>
  681 + // import('@/views/order/rechargeList'),
  682 + // meta: {
  683 + // title: '充值记录',
  684 + // }
  685 + // }, {
  686 + // path: 'shop',
  687 + // name: 'shop',
  688 + // component: () =>
  689 + // import('@/views/order/shopList'),
  690 + // meta: {
  691 + // title: '购买记录',
  692 + // }
  693 + // }]
  694 + // },
  695 + {
  696 + code: '用户管理',
  697 + path: '/user',
  698 + component: Layout,
  699 + redirect: '/',
  700 + name: 'user',
  701 + meta: {
  702 + title: '用户管理',
  703 + icon: 'el-icon-s-help'
  704 + },
  705 + children: [{
  706 + code: '人才库',
  707 + path: 'user',
  708 + name: 'User',
  709 + component: () =>
  710 + import ('@/views/user/userlist'),
  711 + >>>
  712 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  713 + meta: {
  714 + title: '题库管理',
  715 + icon: 'el-icon-s-help',
  716 + permissions: ["admin", "user"],
  717 + },
  718 + children: [{
  719 + path: 'QuestionBank',
  720 + name: 'Table',
  721 + component: () =>
  722 + import ('@/views/QuestionBank/index'),
  723 + meta: {
  724 + title: '题库',
  725 + icon: 'table'
  726 + }
  727 + }, ]
  728 + },
  729 + { <<
  730 + << << < HEAD
  731 + path: '/moduleIndex',
  732 + component: Layout,
  733 + redirect: '/module/index',
  734 + name: 'module',
  735 + ===
  736 + === =
  737 + code: '面试时间表',
  738 + path: 'interviewSchedule',
  739 + name: 'interviewSchedule',
  740 + component: () =>
  741 + import ('@/views/user/InterviewSchedule'),
  742 + >>>
  743 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  744 + meta: {
  745 + title: '面试题',
  746 + icon: 'el-icon-s-help'
  747 + },
  748 + children: [{
  749 + path: 'recharge',
  750 + name: 'recharge',
  751 + component: () =>
  752 + import ('@/views/module/index'),
  753 + meta: {
  754 + title: '面试题',
  755 + icon: 'el-icon-s-operation'
  756 + }
  757 + },
  758 + {
  759 + path: 'index',
  760 + name: 'index',
  761 + component: () =>
  762 + import ('@/views/TestPaper/index'),
  763 + hidden: true,
  764 + meta: {
  765 + title: '试卷维护',
  766 + icon: 'table'
  767 + }
  768 + },
  769 + ]
  770 + },
  771 + // {
  772 + // path: '/realQuestion',
  773 + // component: Layout,
  774 + // redirect: '/module/realQuestion',
  775 + // name: 'realQuestion',
  776 + // meta: {
  777 + // title: '历年真题',
  778 + // icon: 'el-icon-s-help'
  779 + // },
  780 + // children: [{
  781 + // path: 'recharge',
  782 + // name: 'recharge',
  783 + // component: () =>
  784 + // import ('@/views/module/realQuestion'),
  785 + // meta: {
  786 + // title: '历年真题',
  787 + // icon: 'el-icon-s-management'
  788 + // }
  789 + // }]
  790 + // },
602 791  
603   - function hasPermission(permissions, route) {
604   - if (route.meta && route.meta.permissions) {
605   - return permissions.some((role) => route.meta.permissions.includes(role));
606   - } else {
607   - return true;
608   - }
609   - }
  792 + { <<
  793 + << << < HEAD
  794 + path: '/views',
  795 + component: Layout,
  796 + redirect: '/views/TestPaper',
  797 + name: 'TestPaper',
  798 + ===
  799 + === =
  800 + code: 'importuser',
  801 + path: 'importuser',
  802 + name: 'importuser',
610 803  
  804 + component: () =>
  805 + import ('@/views/user/picuserimport'),
  806 + >>>
  807 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  808 + meta: {
  809 + title: '试卷管理',
  810 + icon: 'el-icon-s-help'
  811 + },
  812 + children: [{
  813 + path: 'TestPaperList',
  814 + name: 'Table',
  815 + component: () =>
  816 + import ('@/views/TestPaper/TestPaperList'),
  817 + meta: {
  818 + title: '试卷列表',
  819 + icon: 'table'
  820 + }
  821 + },
  822 + {
  823 + path: 'index',
  824 + name: 'index',
  825 + component: () =>
  826 + import ('@/views/TestPaper/index'),
  827 + hidden: true,
  828 + meta: {
  829 + title: '试卷维护',
  830 + icon: 'table'
  831 + }
  832 + },
  833 + // {
  834 + // path: 'ManualTestPaper',
  835 + // name: 'Table',
  836 + // component: () => import('@/views/TestPaper/ManualTestPaper'),
  837 + // meta: {
  838 + // title: '组卷',
  839 + // icon: 'table'
  840 + // }
  841 + // },
611 842  
612   - function filterAsyncRoutes(routes, permissions) {
613   - const finallyRoutes = [];
614   - routes.forEach((route) => {
615   - const item = { ...route };
616   - // if (hasPermission(permissions, item)) {
617   - if (permissions.includes(item.code) || !item.code) {
618   - if (item.children) {
619   - item.children = filterAsyncRoutes(item.children, permissions);
620   - }
621   - finallyRoutes.push(item);
622   - }
623   - });
624   - return finallyRoutes;
625   - }
626   - constantRoutes1 = filterAsyncRoutes(constantRoutes1, permissions);
627   -
628   - return constantRoutes1;
629   -}
630 843 \ No newline at end of file
  844 + ]
  845 + },
  846 + // {
  847 + // path: '/order',
  848 + // component: Layout,
  849 + // redirect: '/',
  850 + // name: 'order',
  851 + // meta: {
  852 + // title: '订单管理',
  853 + // icon: 'el-icon-s-marketing'
  854 + // },
  855 + // children: [{
  856 + // path: 'recharge',
  857 + // name: 'recharge',
  858 + // component: () =>
  859 + // import('@/views/order/rechargeList'),
  860 + // meta: {
  861 + // title: '充值记录',
  862 + // }
  863 + // }, {
  864 + // path: 'shop',
  865 + // name: 'shop',
  866 + // component: () =>
  867 + // import('@/views/order/shopList'),
  868 + // meta: {
  869 + // title: '购买记录',
  870 + // }
  871 + // }]
  872 + // },
  873 + { <<
  874 + << << < HEAD
  875 + path: '/user',
  876 + component: Layout,
  877 + redirect: '/',
  878 + name: 'user',
  879 + meta: {
  880 + title: '用户管理',
  881 + icon: 'el-icon-s-help'
  882 + },
  883 + children: [{
  884 + path: 'user',
  885 + name: 'User',
  886 + component: () =>
  887 + import ('@/views/user/userlist'),
  888 + meta: {
  889 + title: '人才库',
  890 + } ===
  891 + === =
  892 + code: 'admin',
  893 + path: 'admin',
  894 + name: 'admin',
  895 + component: () =>
  896 + import ('@/views/user/adminList'),
  897 + meta: {
  898 + title: '管理员列表',
  899 + permissions: ['admin']
  900 + }
  901 + },
  902 +
  903 + ]
  904 + }, {
  905 + code: '系统管理',
  906 + path: '/system',
  907 + component: Layout,
  908 + redirect: '/',
  909 + name: 'password',
  910 + meta: {
  911 + title: '系统管理',
  912 + icon: 'el-icon-s-platform'
  913 + },
  914 + children: [{
  915 + code: 'userdimset',
  916 + path: 'userdimset',
  917 + name: 'impouserdimsetrtuser',
  918 +
  919 + component: () =>
  920 + import ('@/views/user/userdimset'),
  921 + meta: {
  922 + title: '维度规则设置',
  923 + permissions: ['admin'] >>>
  924 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  925 + }
  926 +
  927 + ]
  928 + },
  929 + {
  930 + path: '/password',
  931 + component: Layout,
  932 + redirect: '/',
  933 + name: 'password',
  934 + meta: {
  935 + title: '系统管理',
  936 + icon: 'el-icon-s-platform',
  937 + permissions: ['admin', 'user']
  938 + },
  939 + children: [{
  940 + path: 'index',
  941 + name: 'index',
  942 + component: () =>
  943 + import ('@/views/password/index'),
  944 + meta: {
  945 + title: '忘记密码',
  946 + }
  947 + },
  948 + {
  949 + code: 'settings',
  950 + path: 'settings',
  951 + name: 'settings',
  952 + component: () =>
  953 + import ('@/views/settings/index'),
  954 + meta: {
  955 + title: '系统设置',
  956 + }
  957 + },
  958 + {
  959 + code: 'TestPaperClass',
  960 + path: 'TestPaperClass',
  961 + name: 'Table',
  962 + component: () =>
  963 + import ('@/views/TestPaper/TestPaperClass'),
  964 + meta: {
  965 + title: '分类管理',
  966 + permissions: ['admin']
  967 + }
  968 + }, {
  969 + code: 'carousel',
  970 + path: 'carousel',
  971 + name: 'carousel',
  972 + component: () =>
  973 + import ('@/views/carousel/index'),
  974 + meta: {
  975 + title: '轮播图',
  976 + permissions: ['admin']
  977 + }
  978 + }, {
  979 + code: 'new',
  980 + path: 'new',
  981 + name: 'new',
  982 + component: () =>
  983 + import ('@/views/carousel/new'),
  984 + meta: {
  985 + title: '最新资讯',
  986 + permissions: ['admin']
  987 + } <<
  988 + << << < HEAD
  989 + }
  990 + ] ===
  991 + === =
  992 + },
  993 + {
  994 + code: 'rolelist',
  995 + path: 'role',
  996 + name: 'rolelist',
  997 + component: () =>
  998 + import ('@/views/user/rolelist'),
  999 + meta: {
  1000 + title: '角色权限',
  1001 + permissions: ['admin']
  1002 + }
  1003 + },
  1004 + {
  1005 + code: 'logs',
  1006 + path: 'logs',
  1007 + name: 'logs',
  1008 +
  1009 + component: () =>
  1010 + import ('@/views/user/loglist'),
  1011 + meta: {
  1012 + title: '系统日志',
  1013 + }
  1014 + },
  1015 +
  1016 +
  1017 + ]
  1018 + },
  1019 + // 404 page must be placed at the end !!!
  1020 + {
  1021 + path: '*',
  1022 + redirect: '/404',
  1023 + hidden: true
  1024 + }
  1025 + ]
  1026 + } else {
  1027 + return;
  1028 + constantRoutes1 = [{
  1029 + path: '/login',
  1030 + component: () =>
  1031 + import ('@/views/login/index'),
  1032 + hidden: true
  1033 + },
  1034 +
  1035 + {
  1036 + path: '/404',
  1037 + component: () =>
  1038 + import ('@/views/404'),
  1039 + hidden: true
  1040 + },
  1041 +
  1042 + {
  1043 + path: '/example',
  1044 + component: Layout,
  1045 + redirect: '/example/table',
  1046 + name: 'Example',
  1047 + meta: {
  1048 + title: '题库管理',
  1049 + icon: 'el-icon-s-help',
  1050 + permissions: ["admin", "user"],
  1051 + },
  1052 + children: [{
  1053 + path: 'QuestionBank',
  1054 + name: 'Table',
  1055 + component: () =>
  1056 + import ('@/views/QuestionBank/index'),
  1057 + meta: {
  1058 + title: '题库',
  1059 + icon: 'table'
  1060 + }
  1061 + }, ]
  1062 + },
  1063 + {
  1064 + path: '/moduleIndex',
  1065 + component: Layout,
  1066 + redirect: '/module/index',
  1067 + name: 'module',
  1068 + meta: {
  1069 + title: '面试题',
  1070 + icon: 'el-icon-s-help'
  1071 + },
  1072 + children: [{
  1073 + path: 'recharge',
  1074 + name: 'recharge',
  1075 + component: () =>
  1076 + import ('@/views/module/index'),
  1077 + meta: {
  1078 + title: '面试题',
  1079 + icon: 'el-icon-s-operation'
  1080 + } >>>
  1081 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  1082 + },
  1083 + // 404 page must be placed at the end !!!
  1084 + {
  1085 + path: '*',
  1086 + redirect: '/404',
  1087 + hidden: true
  1088 + }
  1089 + ]
  1090 + }
  1091 +
  1092 +
  1093 + function hasPermission(permissions, route) {
  1094 + if (route.meta && route.meta.permissions) {
  1095 + return permissions.some((role) => route.meta.permissions.includes(role));
  1096 + } else {
  1097 + return true;
  1098 + }
  1099 + }
  1100 +
  1101 +
  1102 + function filterAsyncRoutes(routes, permissions) {
  1103 + const finallyRoutes = [];
  1104 + routes.forEach((route) => { <<
  1105 + << << < HEAD
  1106 + const item = {...route };
  1107 + if (hasPermission(permissions, item)) { ===
  1108 + === =
  1109 + const item = {...route };
  1110 + // if (hasPermission(permissions, item)) {
  1111 + if (permissions.includes(item.code) || !item.code) { >>>
  1112 + >>> > b32564ca8a1d0ef59530817c619131f5ed8d1d74
  1113 + if (item.children) {
  1114 + item.children = filterAsyncRoutes(item.children, permissions);
  1115 + }
  1116 + finallyRoutes.push(item);
  1117 + }
  1118 + });
  1119 + return finallyRoutes;
  1120 + }
  1121 + constantRoutes1 = filterAsyncRoutes(constantRoutes1, permissions);
  1122 +
  1123 + return constantRoutes1;
  1124 + }
631 1125 \ No newline at end of file
... ...
vue.config.js
... ... @@ -38,8 +38,8 @@ module.exports = {
38 38 },
39 39 proxy: {
40 40 '/development': {
41   - // target: `http://inteview.t1j2.com/`, //后台服务地址
42   - target:'http://localhost:8877',
  41 + target: `http://admin.7-stars.com.cn/`, //后台服务地址
  42 + // target:'http://localhost:8877',
43 43 // target:'http://localhost:8009',
44 44 changeOrigin: true,
45 45 pathRewrite: {
... ... @@ -47,8 +47,8 @@ module.exports = {
47 47 }
48 48 },
49 49 '/api': {
50   - // target: `http://inteview.t1j2.com/`, //后台服务地址
51   - target: 'http://localhost:8877',
  50 + target: `http://admin.7-stars.com.cn/`, //后台服务地址
  51 + // target: 'http://localhost:8877',
52 52 changeOrigin: true,
53 53 pathRewrite: {}
54 54 }
... ...