From 6239b676b59f64715c85043fef81d782f44bc19a Mon Sep 17 00:00:00 2001 From: yangzhi <765157588@qq.com> Date: Tue, 25 Oct 2022 18:33:18 +0800 Subject: [PATCH] 超哥摸鱼去了 --- src/utils/routerList.js | 936 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ vue.config.js | 6 +++--- 2 files changed, 471 insertions(+), 471 deletions(-) diff --git a/src/utils/routerList.js b/src/utils/routerList.js index 71efe4a..459c571 100644 --- a/src/utils/routerList.js +++ b/src/utils/routerList.js @@ -16,264 +16,497 @@ export function getRoutes(permissions) { let constantRoutes1 = [] if (userInfo.UserId == 1 || 1 == 1) { constantRoutes1 = [{ - path: '/login', - component: () => - import('@/views/login/index'), - hidden: true - }, + path: '/login', + component: () => + import ('@/views/login/index'), + hidden: true + }, - { - path: '/404', - component: () => - import('@/views/404'), - hidden: true - }, + { + path: '/404', + component: () => + import ('@/views/404'), + hidden: true + }, - { - path: '/answerDetail', - name: '答题详情', - component: () => - import('@/views/AnswerResult/detail.vue'), - hidden: true - }, + { + path: '/answerDetail', + name: '答题详情', + component: () => + import ('@/views/AnswerResult/detail.vue'), + hidden: true + }, - { - path: '/', - component: Layout, - redirect: '/dashboard', - children: [{ - path: 'dashboard', - name: '首页', - component: () => - import('@/views/dashboard/index'), + { + path: '/', + component: Layout, + redirect: '/dashboard', + children: [{ + path: 'dashboard', + name: '首页', + component: () => + import ('@/views/dashboard/index'), + meta: { + title: '首页', + icon: 'dashboard' + } + }, { + path: 'live', + name: '直播观看', + component: () => + import ('@/views/live/index'), + meta: { + title: '直播', + icon: 'video' + }, + hidden: true + }] + }, + + { + path: '/example', + component: Layout, + redirect: '/example/table', + name: 'Example', meta: { - title: '首页', - icon: 'dashboard' - } - }, { - path: 'live', - name: '直播观看', - component: () => - import('@/views/live/index'), + title: '题库管理', + icon: 'el-icon-s-help', + permissions: ['admin'] + }, + children: [{ + path: 'QuestionBank', + name: 'Table', + component: () => + import ('@/views/QuestionBank/index'), + meta: { + title: '题库', + icon: 'table', + permissions: ['admin'] + } + }, ] + }, + // { + // path: '/moduleIndex', + // component: Layout, + // redirect: '/module/index', + // name: 'module', + // meta: { + // title: '面试题', + // icon: 'el-icon-s-help' + // }, + // children: [{ + // path: 'index', + // name: 'index', + // component: () => + // import ('@/views/TestPaper/index'), + // hidden: true, + // meta: { + // title: '试卷维护', + // icon: 'table' + // } + // }, ] + // }, + // { + // path: '/realQuestion', + // component: Layout, + // redirect: '/module/realQuestion', + // name: 'realQuestion', + // meta: { + // title: '历年真题', + // icon: 'el-icon-s-help' + // }, + // children: [{ + // path: 'recharge', + // name: 'recharge', + // component: () => + // import ('@/views/module/realQuestion'), + // meta: { + // title: '历年真题', + // icon: 'el-icon-s-management' + // } + // }] + // }, + + { + path: '/views', + component: Layout, + redirect: '/views/TestPaper', + name: 'TestPaper', meta: { - title: '直播', - icon: 'video' + title: '试卷管理', + icon: 'el-icon-s-help' }, - hidden: true - }] - }, + children: [{ + path: 'TestPaperList', + name: 'Table', + component: () => + import ('@/views/TestPaper/TestPaperList'), + meta: { + title: '试卷列表', + icon: 'table' + } + }, + { + path: 'index', + name: 'index', + component: () => + import ('@/views/TestPaper/index'), + hidden: true, + meta: { + title: '试卷维护', + icon: 'table' + } + }, + { + path: 'ManualTestPaper', + name: 'Table', + component: () => + import ('@/views/TestPaper/ManualTestPaper'), + meta: { + title: '组卷', + icon: 'table' + } + }, - { - path: '/example', - component: Layout, - redirect: '/example/table', - name: 'Example', - meta: { - title: '题库管理', - icon: 'el-icon-s-help', - permissions: ['admin'] + ] }, - children: [{ - path: 'QuestionBank', - name: 'Table', - component: () => - import('@/views/QuestionBank/index'), + // { + // path: '/order', + // component: Layout, + // redirect: '/', + // name: 'order', + // meta: { + // title: '订单管理', + // icon: 'el-icon-s-marketing' + // }, + // children: [{ + // path: 'recharge', + // name: 'recharge', + // component: () => + // import('@/views/order/rechargeList'), + // meta: { + // title: '充值记录', + // } + // }, { + // path: 'shop', + // name: 'shop', + // component: () => + // import('@/views/order/shopList'), + // meta: { + // title: '购买记录', + // } + // }] + // }, + { + path: '/user', + component: Layout, + redirect: '/', + name: 'user', meta: { - title: '题库', - icon: 'table', - permissions: ['admin'] - } - },] - }, - // { - // path: '/moduleIndex', - // component: Layout, - // redirect: '/module/index', - // name: 'module', - // meta: { - // title: '面试题', - // icon: 'el-icon-s-help' - // }, - // children: [{ - // path: 'index', - // name: 'index', - // component: () => - // import ('@/views/TestPaper/index'), - // hidden: true, - // meta: { - // title: '试卷维护', - // icon: 'table' - // } - // }, ] - // }, - // { - // path: '/realQuestion', - // component: Layout, - // redirect: '/module/realQuestion', - // name: 'realQuestion', - // meta: { - // title: '历年真题', - // icon: 'el-icon-s-help' - // }, - // children: [{ - // path: 'recharge', - // name: 'recharge', - // component: () => - // import ('@/views/module/realQuestion'), - // meta: { - // title: '历年真题', - // icon: 'el-icon-s-management' - // } - // }] - // }, + title: '用户管理', + icon: 'el-icon-s-help' + }, + children: [{ + path: 'user', + name: 'User', + component: () => + import ('@/views/user/userlist'), + meta: { + title: '人才库', + } + }, + { + path: 'interviewSchedule', + name: 'interviewSchedule', + component: () => + import ('@/views/user/InterviewSchedule'), + meta: { + title: '面试时间表', + } + }, - { - path: '/views', - component: Layout, - redirect: '/views/TestPaper', - name: 'TestPaper', - meta: { - title: '试卷管理', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'TestPaperList', - name: 'Table', - component: () => - import('@/views/TestPaper/TestPaperList'), + { + path: 'importuser', + name: 'importuser', + + component: () => + import ('@/views/user/picuserimport'), + meta: { + title: '图片导入用户', + } + }, + { + path: 'admin', + name: 'admin', + component: () => + import ('@/views/user/adminList'), + meta: { + title: '管理员列表', + permissions: ['admin'] + } + }, + + ] + }, { + path: '/password', + component: Layout, + redirect: '/', + name: 'password', meta: { - title: '试卷列表', - icon: 'table' - } + title: '系统管理', + icon: 'el-icon-s-platform' + }, + children: [{ + path: 'userdimset', + name: 'impouserdimsetrtuser', + + component: () => + import ('@/views/user/userdimset'), + meta: { + title: '维度规则设置', + permissions: ['admin'] + } + }, + { + path: 'index', + name: 'index', + component: () => + import ('@/views/password/index'), + meta: { + title: '忘记密码', + } + }, { + path: 'TestPaperClass', + name: 'Table', + component: () => + import ('@/views/TestPaper/TestPaperClass'), + meta: { + title: '分类管理', + permissions: ['admin'] + } + }, { + path: 'carousel', + name: 'carousel', + component: () => + import ('@/views/carousel/index'), + meta: { + title: '轮播图', + permissions: ['admin'] + } + }, { + path: 'new', + name: 'new', + component: () => + import ('@/views/carousel/new'), + meta: { + title: '最新资讯', + permissions: ['admin'] + } + } + ] }, + // 404 page must be placed at the end !!! { - path: 'index', - name: 'index', + path: '*', + redirect: '/404', + hidden: true + } + ] + } else { + return; + constantRoutes1 = [{ + path: '/login', component: () => - import('@/views/TestPaper/index'), - hidden: true, - meta: { - title: '试卷维护', - icon: 'table' - } + import ('@/views/login/index'), + hidden: true }, + { - path: 'ManualTestPaper', - name: 'Table', + path: '/404', component: () => - import('@/views/TestPaper/ManualTestPaper'), - meta: { - title: '组卷', - icon: 'table' - } + import ('@/views/404'), + hidden: true }, - ] - }, - // { - // path: '/order', - // component: Layout, - // redirect: '/', - // name: 'order', - // meta: { - // title: '订单管理', - // icon: 'el-icon-s-marketing' - // }, - // children: [{ - // path: 'recharge', - // name: 'recharge', - // component: () => - // import('@/views/order/rechargeList'), - // meta: { - // title: '充值记录', - // } - // }, { - // path: 'shop', - // name: 'shop', - // component: () => - // import('@/views/order/shopList'), - // meta: { - // title: '购买记录', - // } - // }] - // }, - { - path: '/user', - component: Layout, - redirect: '/', - name: 'user', - meta: { - title: '用户管理', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'user', - name: 'User', - component: () => - import('@/views/user/userlist'), + { + path: '/example', + component: Layout, + redirect: '/example/table', + name: 'Example', meta: { - title: '人才库', - } + title: '题库管理', + icon: 'el-icon-s-help', + permissions: ["admin", "user"], + }, + children: [{ + path: 'QuestionBank', + name: 'Table', + component: () => + import ('@/views/QuestionBank/index'), + meta: { + title: '题库', + icon: 'table' + } + }, ] }, { - path: 'interviewSchedule', - name: 'interviewSchedule', - component: () => - import('@/views/user/InterviewSchedule'), + path: '/moduleIndex', + component: Layout, + redirect: '/module/index', + name: 'module', meta: { - title: '面试时间表', - } + title: '面试题', + icon: 'el-icon-s-help' + }, + children: [{ + path: 'recharge', + name: 'recharge', + component: () => + import ('@/views/module/index'), + meta: { + title: '面试题', + icon: 'el-icon-s-operation' + } + }, + { + path: 'index', + name: 'index', + component: () => + import ('@/views/TestPaper/index'), + hidden: true, + meta: { + title: '试卷维护', + icon: 'table' + } + }, + ] }, + // { + // path: '/realQuestion', + // component: Layout, + // redirect: '/module/realQuestion', + // name: 'realQuestion', + // meta: { + // title: '历年真题', + // icon: 'el-icon-s-help' + // }, + // children: [{ + // path: 'recharge', + // name: 'recharge', + // component: () => + // import ('@/views/module/realQuestion'), + // meta: { + // title: '历年真题', + // icon: 'el-icon-s-management' + // } + // }] + // }, { - path: 'importuser', - name: 'importuser', - - component: () => - import('@/views/user/picuserimport'), + path: '/views', + component: Layout, + redirect: '/views/TestPaper', + name: 'TestPaper', meta: { - title: '图片导入用户', - } + title: '试卷管理', + icon: 'el-icon-s-help' + }, + children: [{ + path: 'TestPaperList', + name: 'Table', + component: () => + import ('@/views/TestPaper/TestPaperList'), + meta: { + title: '试卷列表', + icon: 'table' + } + }, + { + path: 'index', + name: 'index', + component: () => + import ('@/views/TestPaper/index'), + hidden: true, + meta: { + title: '试卷维护', + icon: 'table' + } + }, + // { + // path: 'ManualTestPaper', + // name: 'Table', + // component: () => import('@/views/TestPaper/ManualTestPaper'), + // meta: { + // title: '组卷', + // icon: 'table' + // } + // }, + + ] }, + // { + // path: '/order', + // component: Layout, + // redirect: '/', + // name: 'order', + // meta: { + // title: '订单管理', + // icon: 'el-icon-s-marketing' + // }, + // children: [{ + // path: 'recharge', + // name: 'recharge', + // component: () => + // import('@/views/order/rechargeList'), + // meta: { + // title: '充值记录', + // } + // }, { + // path: 'shop', + // name: 'shop', + // component: () => + // import('@/views/order/shopList'), + // meta: { + // title: '购买记录', + // } + // }] + // }, { - path: 'admin', - name: 'admin', - component: () => - import('@/views/user/adminList'), + path: '/user', + component: Layout, + redirect: '/', + name: 'user', meta: { - title: '管理员列表', - permissions: ['admin'] - } - }, - - ] - }, { - path: '/password', - component: Layout, - redirect: '/', - name: 'password', - meta: { - title: '系统管理', - icon: 'el-icon-s-platform' - }, - children: [ - { - path: 'userdimset', - name: 'impouserdimsetrtuser', - - component: () => - import('@/views/user/userdimset'), - meta: { - title: '维度规则设置', - permissions:['admin' ] + title: '用户管理', + icon: 'el-icon-s-help' + }, + children: [{ + path: 'user', + name: 'User', + component: () => + import ('@/views/user/userlist'), + meta: { + title: '人才库', + } } + + ] + }, { + path: '/password', + component: Layout, + redirect: '/', + name: 'password', + meta: { + title: '系统管理', + icon: 'el-icon-s-platform', + permissions: ['admin', 'user'] }, - { + children: [{ path: 'index', name: 'index', component: () => - import('@/views/password/index'), + import ('@/views/password/index'), meta: { title: '忘记密码', } @@ -281,270 +514,37 @@ export function getRoutes(permissions) { path: 'TestPaperClass', name: 'Table', component: () => - import('@/views/TestPaper/TestPaperClass'), + import ('@/views/TestPaper/TestPaperClass'), meta: { title: '分类管理', - permissions:['admin' ] + permissions: ['admin'] } }, { path: 'carousel', name: 'carousel', component: () => - import('@/views/carousel/index'), + import ('@/views/carousel/index'), meta: { title: '轮播图', - permissions:['admin' ] + permissions: ['admin'] } }, { path: 'new', name: 'new', component: () => - import('@/views/carousel/new'), + import ('@/views/carousel/new'), meta: { title: '最新资讯', - permissions:['admin'] + permissions: ['admin'] } }] - }, - // 404 page must be placed at the end !!! - { - path: '*', - redirect: '/404', - hidden: true - } - ] - } else { - return ; - constantRoutes1 = [{ - path: '/login', - component: () => - import('@/views/login/index'), - hidden: true - }, - - { - path: '/404', - component: () => - import('@/views/404'), - hidden: true - }, - - { - path: '/example', - component: Layout, - redirect: '/example/table', - name: 'Example', - meta: { - title: '题库管理', - icon: 'el-icon-s-help', - permissions: ["admin", "user"], - }, - children: [{ - path: 'QuestionBank', - name: 'Table', - component: () => - import('@/views/QuestionBank/index'), - meta: { - title: '题库', - icon: 'table' - } - },] - }, - { - path: '/moduleIndex', - component: Layout, - redirect: '/module/index', - name: 'module', - meta: { - title: '面试题', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'recharge', - name: 'recharge', - component: () => - import('@/views/module/index'), - meta: { - title: '面试题', - icon: 'el-icon-s-operation' - } }, + // 404 page must be placed at the end !!! { - path: 'index', - name: 'index', - component: () => - import('@/views/TestPaper/index'), - hidden: true, - meta: { - title: '试卷维护', - icon: 'table' - } - }, - ] - }, - // { - // path: '/realQuestion', - // component: Layout, - // redirect: '/module/realQuestion', - // name: 'realQuestion', - // meta: { - // title: '历年真题', - // icon: 'el-icon-s-help' - // }, - // children: [{ - // path: 'recharge', - // name: 'recharge', - // component: () => - // import ('@/views/module/realQuestion'), - // meta: { - // title: '历年真题', - // icon: 'el-icon-s-management' - // } - // }] - // }, - - { - path: '/views', - component: Layout, - redirect: '/views/TestPaper', - name: 'TestPaper', - meta: { - title: '试卷管理', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'TestPaperList', - name: 'Table', - component: () => - import('@/views/TestPaper/TestPaperList'), - meta: { - title: '试卷列表', - icon: 'table' - } - }, - { - path: 'index', - name: 'index', - component: () => - import('@/views/TestPaper/index'), - hidden: true, - meta: { - title: '试卷维护', - icon: 'table' - } - }, - // { - // path: 'ManualTestPaper', - // name: 'Table', - // component: () => import('@/views/TestPaper/ManualTestPaper'), - // meta: { - // title: '组卷', - // icon: 'table' - // } - // }, - - ] - }, - // { - // path: '/order', - // component: Layout, - // redirect: '/', - // name: 'order', - // meta: { - // title: '订单管理', - // icon: 'el-icon-s-marketing' - // }, - // children: [{ - // path: 'recharge', - // name: 'recharge', - // component: () => - // import('@/views/order/rechargeList'), - // meta: { - // title: '充值记录', - // } - // }, { - // path: 'shop', - // name: 'shop', - // component: () => - // import('@/views/order/shopList'), - // meta: { - // title: '购买记录', - // } - // }] - // }, - { - path: '/user', - component: Layout, - redirect: '/', - name: 'user', - meta: { - title: '用户管理', - icon: 'el-icon-s-help' - }, - children: [{ - path: 'user', - name: 'User', - component: () => - import('@/views/user/userlist'), - meta: { - title: '人才库', - } + path: '*', + redirect: '/404', + hidden: true } - - ] - }, { - path: '/password', - component: Layout, - redirect: '/', - name: 'password', - meta: { - title: '系统管理', - icon: 'el-icon-s-platform', - permissions:['admin','user'] - }, - children: [{ - path: 'index', - name: 'index', - component: () => - import('@/views/password/index'), - meta: { - title: '忘记密码', - } - }, { - path: 'TestPaperClass', - name: 'Table', - component: () => - import('@/views/TestPaper/TestPaperClass'), - meta: { - title: '分类管理', - permissions: ['admin'] - } - }, { - path: 'carousel', - name: 'carousel', - component: () => - import('@/views/carousel/index'), - meta: { - title: '轮播图', - permissions: ['admin'] - } - }, { - path: 'new', - name: 'new', - component: () => - import('@/views/carousel/new'), - meta: { - title: '最新资讯', - permissions: ['admin'] - } - }] - }, - // 404 page must be placed at the end !!! - { - path: '*', - redirect: '/404', - hidden: true - } ] } @@ -558,10 +558,10 @@ export function getRoutes(permissions) { } - function filterAsyncRoutes(routes, permissions) { + function filterAsyncRoutes(routes, permissions) { const finallyRoutes = []; routes.forEach((route) => { - const item = { ...route }; + const item = {...route }; if (hasPermission(permissions, item)) { if (item.children) { item.children = filterAsyncRoutes(item.children, permissions); @@ -570,7 +570,7 @@ export function getRoutes(permissions) { } }); return finallyRoutes; - } + } constantRoutes1 = filterAsyncRoutes(constantRoutes1, permissions); return constantRoutes1; diff --git a/vue.config.js b/vue.config.js index 2f0ae23..fe7e4ca 100644 --- a/vue.config.js +++ b/vue.config.js @@ -38,8 +38,8 @@ module.exports = { }, proxy: { '/development': { - // target: `http://inteview.t1j2.com/`, //后台服务地址 - target:'http://localhost:8877', + target: `http://admin.7-stars.com.cn/`, //后台服务地址 + // target:'http://localhost:8877', // target:'http://localhost:8009', changeOrigin: true, pathRewrite: { @@ -47,7 +47,7 @@ module.exports = { } }, '/api': { - target: `http://inteview.t1j2.com/`, //后台服务地址 + target: `http://admin.7-stars.com.cn/`, //后台服务地址 // target: 'http://localhost:8877', changeOrigin: true, pathRewrite: {} -- libgit2 0.21.4