Commit 6239b676b59f64715c85043fef81d782f44bc19a
1 parent
8a0be2f3
超哥摸鱼去了
Showing
2 changed files
with
471 additions
and
471 deletions
src/utils/routerList.js
| ... | ... | @@ -16,264 +16,497 @@ export function getRoutes(permissions) { |
| 16 | 16 | let constantRoutes1 = [] |
| 17 | 17 | if (userInfo.UserId == 1 || 1 == 1) { |
| 18 | 18 | constantRoutes1 = [{ |
| 19 | - path: '/login', | |
| 20 | - component: () => | |
| 21 | - import('@/views/login/index'), | |
| 22 | - hidden: true | |
| 23 | - }, | |
| 19 | + path: '/login', | |
| 20 | + component: () => | |
| 21 | + import ('@/views/login/index'), | |
| 22 | + hidden: true | |
| 23 | + }, | |
| 24 | 24 | |
| 25 | - { | |
| 26 | - path: '/404', | |
| 27 | - component: () => | |
| 28 | - import('@/views/404'), | |
| 29 | - hidden: true | |
| 30 | - }, | |
| 25 | + { | |
| 26 | + path: '/404', | |
| 27 | + component: () => | |
| 28 | + import ('@/views/404'), | |
| 29 | + hidden: true | |
| 30 | + }, | |
| 31 | 31 | |
| 32 | - { | |
| 33 | - path: '/answerDetail', | |
| 34 | - name: '答题详情', | |
| 35 | - component: () => | |
| 36 | - import('@/views/AnswerResult/detail.vue'), | |
| 37 | - hidden: true | |
| 38 | - }, | |
| 32 | + { | |
| 33 | + path: '/answerDetail', | |
| 34 | + name: '答题详情', | |
| 35 | + component: () => | |
| 36 | + import ('@/views/AnswerResult/detail.vue'), | |
| 37 | + hidden: true | |
| 38 | + }, | |
| 39 | 39 | |
| 40 | 40 | |
| 41 | - { | |
| 42 | - path: '/', | |
| 43 | - component: Layout, | |
| 44 | - redirect: '/dashboard', | |
| 45 | - children: [{ | |
| 46 | - path: 'dashboard', | |
| 47 | - name: '首页', | |
| 48 | - component: () => | |
| 49 | - import('@/views/dashboard/index'), | |
| 41 | + { | |
| 42 | + path: '/', | |
| 43 | + component: Layout, | |
| 44 | + redirect: '/dashboard', | |
| 45 | + children: [{ | |
| 46 | + path: 'dashboard', | |
| 47 | + name: '首页', | |
| 48 | + component: () => | |
| 49 | + import ('@/views/dashboard/index'), | |
| 50 | + meta: { | |
| 51 | + title: '首页', | |
| 52 | + icon: 'dashboard' | |
| 53 | + } | |
| 54 | + }, { | |
| 55 | + path: 'live', | |
| 56 | + name: '直播观看', | |
| 57 | + component: () => | |
| 58 | + import ('@/views/live/index'), | |
| 59 | + meta: { | |
| 60 | + title: '直播', | |
| 61 | + icon: 'video' | |
| 62 | + }, | |
| 63 | + hidden: true | |
| 64 | + }] | |
| 65 | + }, | |
| 66 | + | |
| 67 | + { | |
| 68 | + path: '/example', | |
| 69 | + component: Layout, | |
| 70 | + redirect: '/example/table', | |
| 71 | + name: 'Example', | |
| 50 | 72 | meta: { |
| 51 | - title: '首页', | |
| 52 | - icon: 'dashboard' | |
| 53 | - } | |
| 54 | - }, { | |
| 55 | - path: 'live', | |
| 56 | - name: '直播观看', | |
| 57 | - component: () => | |
| 58 | - import('@/views/live/index'), | |
| 73 | + title: '题库管理', | |
| 74 | + icon: 'el-icon-s-help', | |
| 75 | + permissions: ['admin'] | |
| 76 | + }, | |
| 77 | + children: [{ | |
| 78 | + path: 'QuestionBank', | |
| 79 | + name: 'Table', | |
| 80 | + component: () => | |
| 81 | + import ('@/views/QuestionBank/index'), | |
| 82 | + meta: { | |
| 83 | + title: '题库', | |
| 84 | + icon: 'table', | |
| 85 | + permissions: ['admin'] | |
| 86 | + } | |
| 87 | + }, ] | |
| 88 | + }, | |
| 89 | + // { | |
| 90 | + // path: '/moduleIndex', | |
| 91 | + // component: Layout, | |
| 92 | + // redirect: '/module/index', | |
| 93 | + // name: 'module', | |
| 94 | + // meta: { | |
| 95 | + // title: '面试题', | |
| 96 | + // icon: 'el-icon-s-help' | |
| 97 | + // }, | |
| 98 | + // children: [{ | |
| 99 | + // path: 'index', | |
| 100 | + // name: 'index', | |
| 101 | + // component: () => | |
| 102 | + // import ('@/views/TestPaper/index'), | |
| 103 | + // hidden: true, | |
| 104 | + // meta: { | |
| 105 | + // title: '试卷维护', | |
| 106 | + // icon: 'table' | |
| 107 | + // } | |
| 108 | + // }, ] | |
| 109 | + // }, | |
| 110 | + // { | |
| 111 | + // path: '/realQuestion', | |
| 112 | + // component: Layout, | |
| 113 | + // redirect: '/module/realQuestion', | |
| 114 | + // name: 'realQuestion', | |
| 115 | + // meta: { | |
| 116 | + // title: '历年真题', | |
| 117 | + // icon: 'el-icon-s-help' | |
| 118 | + // }, | |
| 119 | + // children: [{ | |
| 120 | + // path: 'recharge', | |
| 121 | + // name: 'recharge', | |
| 122 | + // component: () => | |
| 123 | + // import ('@/views/module/realQuestion'), | |
| 124 | + // meta: { | |
| 125 | + // title: '历年真题', | |
| 126 | + // icon: 'el-icon-s-management' | |
| 127 | + // } | |
| 128 | + // }] | |
| 129 | + // }, | |
| 130 | + | |
| 131 | + { | |
| 132 | + path: '/views', | |
| 133 | + component: Layout, | |
| 134 | + redirect: '/views/TestPaper', | |
| 135 | + name: 'TestPaper', | |
| 59 | 136 | meta: { |
| 60 | - title: '直播', | |
| 61 | - icon: 'video' | |
| 137 | + title: '试卷管理', | |
| 138 | + icon: 'el-icon-s-help' | |
| 62 | 139 | }, |
| 63 | - hidden: true | |
| 64 | - }] | |
| 65 | - }, | |
| 140 | + children: [{ | |
| 141 | + path: 'TestPaperList', | |
| 142 | + name: 'Table', | |
| 143 | + component: () => | |
| 144 | + import ('@/views/TestPaper/TestPaperList'), | |
| 145 | + meta: { | |
| 146 | + title: '试卷列表', | |
| 147 | + icon: 'table' | |
| 148 | + } | |
| 149 | + }, | |
| 150 | + { | |
| 151 | + path: 'index', | |
| 152 | + name: 'index', | |
| 153 | + component: () => | |
| 154 | + import ('@/views/TestPaper/index'), | |
| 155 | + hidden: true, | |
| 156 | + meta: { | |
| 157 | + title: '试卷维护', | |
| 158 | + icon: 'table' | |
| 159 | + } | |
| 160 | + }, | |
| 161 | + { | |
| 162 | + path: 'ManualTestPaper', | |
| 163 | + name: 'Table', | |
| 164 | + component: () => | |
| 165 | + import ('@/views/TestPaper/ManualTestPaper'), | |
| 166 | + meta: { | |
| 167 | + title: '组卷', | |
| 168 | + icon: 'table' | |
| 169 | + } | |
| 170 | + }, | |
| 66 | 171 | |
| 67 | - { | |
| 68 | - path: '/example', | |
| 69 | - component: Layout, | |
| 70 | - redirect: '/example/table', | |
| 71 | - name: 'Example', | |
| 72 | - meta: { | |
| 73 | - title: '题库管理', | |
| 74 | - icon: 'el-icon-s-help', | |
| 75 | - permissions: ['admin'] | |
| 172 | + ] | |
| 76 | 173 | }, |
| 77 | - children: [{ | |
| 78 | - path: 'QuestionBank', | |
| 79 | - name: 'Table', | |
| 80 | - component: () => | |
| 81 | - import('@/views/QuestionBank/index'), | |
| 174 | + // { | |
| 175 | + // path: '/order', | |
| 176 | + // component: Layout, | |
| 177 | + // redirect: '/', | |
| 178 | + // name: 'order', | |
| 179 | + // meta: { | |
| 180 | + // title: '订单管理', | |
| 181 | + // icon: 'el-icon-s-marketing' | |
| 182 | + // }, | |
| 183 | + // children: [{ | |
| 184 | + // path: 'recharge', | |
| 185 | + // name: 'recharge', | |
| 186 | + // component: () => | |
| 187 | + // import('@/views/order/rechargeList'), | |
| 188 | + // meta: { | |
| 189 | + // title: '充值记录', | |
| 190 | + // } | |
| 191 | + // }, { | |
| 192 | + // path: 'shop', | |
| 193 | + // name: 'shop', | |
| 194 | + // component: () => | |
| 195 | + // import('@/views/order/shopList'), | |
| 196 | + // meta: { | |
| 197 | + // title: '购买记录', | |
| 198 | + // } | |
| 199 | + // }] | |
| 200 | + // }, | |
| 201 | + { | |
| 202 | + path: '/user', | |
| 203 | + component: Layout, | |
| 204 | + redirect: '/', | |
| 205 | + name: 'user', | |
| 82 | 206 | meta: { |
| 83 | - title: '题库', | |
| 84 | - icon: 'table', | |
| 85 | - permissions: ['admin'] | |
| 86 | - } | |
| 87 | - },] | |
| 88 | - }, | |
| 89 | - // { | |
| 90 | - // path: '/moduleIndex', | |
| 91 | - // component: Layout, | |
| 92 | - // redirect: '/module/index', | |
| 93 | - // name: 'module', | |
| 94 | - // meta: { | |
| 95 | - // title: '面试题', | |
| 96 | - // icon: 'el-icon-s-help' | |
| 97 | - // }, | |
| 98 | - // children: [{ | |
| 99 | - // path: 'index', | |
| 100 | - // name: 'index', | |
| 101 | - // component: () => | |
| 102 | - // import ('@/views/TestPaper/index'), | |
| 103 | - // hidden: true, | |
| 104 | - // meta: { | |
| 105 | - // title: '试卷维护', | |
| 106 | - // icon: 'table' | |
| 107 | - // } | |
| 108 | - // }, ] | |
| 109 | - // }, | |
| 110 | - // { | |
| 111 | - // path: '/realQuestion', | |
| 112 | - // component: Layout, | |
| 113 | - // redirect: '/module/realQuestion', | |
| 114 | - // name: 'realQuestion', | |
| 115 | - // meta: { | |
| 116 | - // title: '历年真题', | |
| 117 | - // icon: 'el-icon-s-help' | |
| 118 | - // }, | |
| 119 | - // children: [{ | |
| 120 | - // path: 'recharge', | |
| 121 | - // name: 'recharge', | |
| 122 | - // component: () => | |
| 123 | - // import ('@/views/module/realQuestion'), | |
| 124 | - // meta: { | |
| 125 | - // title: '历年真题', | |
| 126 | - // icon: 'el-icon-s-management' | |
| 127 | - // } | |
| 128 | - // }] | |
| 129 | - // }, | |
| 207 | + title: '用户管理', | |
| 208 | + icon: 'el-icon-s-help' | |
| 209 | + }, | |
| 210 | + children: [{ | |
| 211 | + path: 'user', | |
| 212 | + name: 'User', | |
| 213 | + component: () => | |
| 214 | + import ('@/views/user/userlist'), | |
| 215 | + meta: { | |
| 216 | + title: '人才库', | |
| 217 | + } | |
| 218 | + }, | |
| 219 | + { | |
| 220 | + path: 'interviewSchedule', | |
| 221 | + name: 'interviewSchedule', | |
| 222 | + component: () => | |
| 223 | + import ('@/views/user/InterviewSchedule'), | |
| 224 | + meta: { | |
| 225 | + title: '面试时间表', | |
| 226 | + } | |
| 227 | + }, | |
| 130 | 228 | |
| 131 | - { | |
| 132 | - path: '/views', | |
| 133 | - component: Layout, | |
| 134 | - redirect: '/views/TestPaper', | |
| 135 | - name: 'TestPaper', | |
| 136 | - meta: { | |
| 137 | - title: '试卷管理', | |
| 138 | - icon: 'el-icon-s-help' | |
| 139 | - }, | |
| 140 | - children: [{ | |
| 141 | - path: 'TestPaperList', | |
| 142 | - name: 'Table', | |
| 143 | - component: () => | |
| 144 | - import('@/views/TestPaper/TestPaperList'), | |
| 229 | + { | |
| 230 | + path: 'importuser', | |
| 231 | + name: 'importuser', | |
| 232 | + | |
| 233 | + component: () => | |
| 234 | + import ('@/views/user/picuserimport'), | |
| 235 | + meta: { | |
| 236 | + title: '图片导入用户', | |
| 237 | + } | |
| 238 | + }, | |
| 239 | + { | |
| 240 | + path: 'admin', | |
| 241 | + name: 'admin', | |
| 242 | + component: () => | |
| 243 | + import ('@/views/user/adminList'), | |
| 244 | + meta: { | |
| 245 | + title: '管理员列表', | |
| 246 | + permissions: ['admin'] | |
| 247 | + } | |
| 248 | + }, | |
| 249 | + | |
| 250 | + ] | |
| 251 | + }, { | |
| 252 | + path: '/password', | |
| 253 | + component: Layout, | |
| 254 | + redirect: '/', | |
| 255 | + name: 'password', | |
| 145 | 256 | meta: { |
| 146 | - title: '试卷列表', | |
| 147 | - icon: 'table' | |
| 148 | - } | |
| 257 | + title: '系统管理', | |
| 258 | + icon: 'el-icon-s-platform' | |
| 259 | + }, | |
| 260 | + children: [{ | |
| 261 | + path: 'userdimset', | |
| 262 | + name: 'impouserdimsetrtuser', | |
| 263 | + | |
| 264 | + component: () => | |
| 265 | + import ('@/views/user/userdimset'), | |
| 266 | + meta: { | |
| 267 | + title: '维度规则设置', | |
| 268 | + permissions: ['admin'] | |
| 269 | + } | |
| 270 | + }, | |
| 271 | + { | |
| 272 | + path: 'index', | |
| 273 | + name: 'index', | |
| 274 | + component: () => | |
| 275 | + import ('@/views/password/index'), | |
| 276 | + meta: { | |
| 277 | + title: '忘记密码', | |
| 278 | + } | |
| 279 | + }, { | |
| 280 | + path: 'TestPaperClass', | |
| 281 | + name: 'Table', | |
| 282 | + component: () => | |
| 283 | + import ('@/views/TestPaper/TestPaperClass'), | |
| 284 | + meta: { | |
| 285 | + title: '分类管理', | |
| 286 | + permissions: ['admin'] | |
| 287 | + } | |
| 288 | + }, { | |
| 289 | + path: 'carousel', | |
| 290 | + name: 'carousel', | |
| 291 | + component: () => | |
| 292 | + import ('@/views/carousel/index'), | |
| 293 | + meta: { | |
| 294 | + title: '轮播图', | |
| 295 | + permissions: ['admin'] | |
| 296 | + } | |
| 297 | + }, { | |
| 298 | + path: 'new', | |
| 299 | + name: 'new', | |
| 300 | + component: () => | |
| 301 | + import ('@/views/carousel/new'), | |
| 302 | + meta: { | |
| 303 | + title: '最新资讯', | |
| 304 | + permissions: ['admin'] | |
| 305 | + } | |
| 306 | + } | |
| 307 | + ] | |
| 149 | 308 | }, |
| 309 | + // 404 page must be placed at the end !!! | |
| 150 | 310 | { |
| 151 | - path: 'index', | |
| 152 | - name: 'index', | |
| 311 | + path: '*', | |
| 312 | + redirect: '/404', | |
| 313 | + hidden: true | |
| 314 | + } | |
| 315 | + ] | |
| 316 | + } else { | |
| 317 | + return; | |
| 318 | + constantRoutes1 = [{ | |
| 319 | + path: '/login', | |
| 153 | 320 | component: () => |
| 154 | - import('@/views/TestPaper/index'), | |
| 155 | - hidden: true, | |
| 156 | - meta: { | |
| 157 | - title: '试卷维护', | |
| 158 | - icon: 'table' | |
| 159 | - } | |
| 321 | + import ('@/views/login/index'), | |
| 322 | + hidden: true | |
| 160 | 323 | }, |
| 324 | + | |
| 161 | 325 | { |
| 162 | - path: 'ManualTestPaper', | |
| 163 | - name: 'Table', | |
| 326 | + path: '/404', | |
| 164 | 327 | component: () => |
| 165 | - import('@/views/TestPaper/ManualTestPaper'), | |
| 166 | - meta: { | |
| 167 | - title: '组卷', | |
| 168 | - icon: 'table' | |
| 169 | - } | |
| 328 | + import ('@/views/404'), | |
| 329 | + hidden: true | |
| 170 | 330 | }, |
| 171 | 331 | |
| 172 | - ] | |
| 173 | - }, | |
| 174 | - // { | |
| 175 | - // path: '/order', | |
| 176 | - // component: Layout, | |
| 177 | - // redirect: '/', | |
| 178 | - // name: 'order', | |
| 179 | - // meta: { | |
| 180 | - // title: '订单管理', | |
| 181 | - // icon: 'el-icon-s-marketing' | |
| 182 | - // }, | |
| 183 | - // children: [{ | |
| 184 | - // path: 'recharge', | |
| 185 | - // name: 'recharge', | |
| 186 | - // component: () => | |
| 187 | - // import('@/views/order/rechargeList'), | |
| 188 | - // meta: { | |
| 189 | - // title: '充值记录', | |
| 190 | - // } | |
| 191 | - // }, { | |
| 192 | - // path: 'shop', | |
| 193 | - // name: 'shop', | |
| 194 | - // component: () => | |
| 195 | - // import('@/views/order/shopList'), | |
| 196 | - // meta: { | |
| 197 | - // title: '购买记录', | |
| 198 | - // } | |
| 199 | - // }] | |
| 200 | - // }, | |
| 201 | - { | |
| 202 | - path: '/user', | |
| 203 | - component: Layout, | |
| 204 | - redirect: '/', | |
| 205 | - name: 'user', | |
| 206 | - meta: { | |
| 207 | - title: '用户管理', | |
| 208 | - icon: 'el-icon-s-help' | |
| 209 | - }, | |
| 210 | - children: [{ | |
| 211 | - path: 'user', | |
| 212 | - name: 'User', | |
| 213 | - component: () => | |
| 214 | - import('@/views/user/userlist'), | |
| 332 | + { | |
| 333 | + path: '/example', | |
| 334 | + component: Layout, | |
| 335 | + redirect: '/example/table', | |
| 336 | + name: 'Example', | |
| 215 | 337 | meta: { |
| 216 | - title: '人才库', | |
| 217 | - } | |
| 338 | + title: '题库管理', | |
| 339 | + icon: 'el-icon-s-help', | |
| 340 | + permissions: ["admin", "user"], | |
| 341 | + }, | |
| 342 | + children: [{ | |
| 343 | + path: 'QuestionBank', | |
| 344 | + name: 'Table', | |
| 345 | + component: () => | |
| 346 | + import ('@/views/QuestionBank/index'), | |
| 347 | + meta: { | |
| 348 | + title: '题库', | |
| 349 | + icon: 'table' | |
| 350 | + } | |
| 351 | + }, ] | |
| 218 | 352 | }, |
| 219 | 353 | { |
| 220 | - path: 'interviewSchedule', | |
| 221 | - name: 'interviewSchedule', | |
| 222 | - component: () => | |
| 223 | - import('@/views/user/InterviewSchedule'), | |
| 354 | + path: '/moduleIndex', | |
| 355 | + component: Layout, | |
| 356 | + redirect: '/module/index', | |
| 357 | + name: 'module', | |
| 224 | 358 | meta: { |
| 225 | - title: '面试时间表', | |
| 226 | - } | |
| 359 | + title: '面试题', | |
| 360 | + icon: 'el-icon-s-help' | |
| 361 | + }, | |
| 362 | + children: [{ | |
| 363 | + path: 'recharge', | |
| 364 | + name: 'recharge', | |
| 365 | + component: () => | |
| 366 | + import ('@/views/module/index'), | |
| 367 | + meta: { | |
| 368 | + title: '面试题', | |
| 369 | + icon: 'el-icon-s-operation' | |
| 370 | + } | |
| 371 | + }, | |
| 372 | + { | |
| 373 | + path: 'index', | |
| 374 | + name: 'index', | |
| 375 | + component: () => | |
| 376 | + import ('@/views/TestPaper/index'), | |
| 377 | + hidden: true, | |
| 378 | + meta: { | |
| 379 | + title: '试卷维护', | |
| 380 | + icon: 'table' | |
| 381 | + } | |
| 382 | + }, | |
| 383 | + ] | |
| 227 | 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 | + // }, | |
| 228 | 405 | |
| 229 | 406 | { |
| 230 | - path: 'importuser', | |
| 231 | - name: 'importuser', | |
| 232 | - | |
| 233 | - component: () => | |
| 234 | - import('@/views/user/picuserimport'), | |
| 407 | + path: '/views', | |
| 408 | + component: Layout, | |
| 409 | + redirect: '/views/TestPaper', | |
| 410 | + name: 'TestPaper', | |
| 235 | 411 | meta: { |
| 236 | - title: '图片导入用户', | |
| 237 | - } | |
| 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: () => import('@/views/TestPaper/ManualTestPaper'), | |
| 440 | + // meta: { | |
| 441 | + // title: '组卷', | |
| 442 | + // icon: 'table' | |
| 443 | + // } | |
| 444 | + // }, | |
| 445 | + | |
| 446 | + ] | |
| 238 | 447 | }, |
| 448 | + // { | |
| 449 | + // path: '/order', | |
| 450 | + // component: Layout, | |
| 451 | + // redirect: '/', | |
| 452 | + // name: 'order', | |
| 453 | + // meta: { | |
| 454 | + // title: '订单管理', | |
| 455 | + // icon: 'el-icon-s-marketing' | |
| 456 | + // }, | |
| 457 | + // children: [{ | |
| 458 | + // path: 'recharge', | |
| 459 | + // name: 'recharge', | |
| 460 | + // component: () => | |
| 461 | + // import('@/views/order/rechargeList'), | |
| 462 | + // meta: { | |
| 463 | + // title: '充值记录', | |
| 464 | + // } | |
| 465 | + // }, { | |
| 466 | + // path: 'shop', | |
| 467 | + // name: 'shop', | |
| 468 | + // component: () => | |
| 469 | + // import('@/views/order/shopList'), | |
| 470 | + // meta: { | |
| 471 | + // title: '购买记录', | |
| 472 | + // } | |
| 473 | + // }] | |
| 474 | + // }, | |
| 239 | 475 | { |
| 240 | - path: 'admin', | |
| 241 | - name: 'admin', | |
| 242 | - component: () => | |
| 243 | - import('@/views/user/adminList'), | |
| 476 | + path: '/user', | |
| 477 | + component: Layout, | |
| 478 | + redirect: '/', | |
| 479 | + name: 'user', | |
| 244 | 480 | meta: { |
| 245 | - title: '管理员列表', | |
| 246 | - permissions: ['admin'] | |
| 247 | - } | |
| 248 | - }, | |
| 249 | - | |
| 250 | - ] | |
| 251 | - }, { | |
| 252 | - path: '/password', | |
| 253 | - component: Layout, | |
| 254 | - redirect: '/', | |
| 255 | - name: 'password', | |
| 256 | - meta: { | |
| 257 | - title: '系统管理', | |
| 258 | - icon: 'el-icon-s-platform' | |
| 259 | - }, | |
| 260 | - children: [ | |
| 261 | - { | |
| 262 | - path: 'userdimset', | |
| 263 | - name: 'impouserdimsetrtuser', | |
| 264 | - | |
| 265 | - component: () => | |
| 266 | - import('@/views/user/userdimset'), | |
| 267 | - meta: { | |
| 268 | - title: '维度规则设置', | |
| 269 | - permissions:['admin' ] | |
| 481 | + title: '用户管理', | |
| 482 | + icon: 'el-icon-s-help' | |
| 483 | + }, | |
| 484 | + children: [{ | |
| 485 | + path: 'user', | |
| 486 | + name: 'User', | |
| 487 | + component: () => | |
| 488 | + import ('@/views/user/userlist'), | |
| 489 | + meta: { | |
| 490 | + title: '人才库', | |
| 491 | + } | |
| 270 | 492 | } |
| 493 | + | |
| 494 | + ] | |
| 495 | + }, { | |
| 496 | + path: '/password', | |
| 497 | + component: Layout, | |
| 498 | + redirect: '/', | |
| 499 | + name: 'password', | |
| 500 | + meta: { | |
| 501 | + title: '系统管理', | |
| 502 | + icon: 'el-icon-s-platform', | |
| 503 | + permissions: ['admin', 'user'] | |
| 271 | 504 | }, |
| 272 | - { | |
| 505 | + children: [{ | |
| 273 | 506 | path: 'index', |
| 274 | 507 | name: 'index', |
| 275 | 508 | component: () => |
| 276 | - import('@/views/password/index'), | |
| 509 | + import ('@/views/password/index'), | |
| 277 | 510 | meta: { |
| 278 | 511 | title: '忘记密码', |
| 279 | 512 | } |
| ... | ... | @@ -281,270 +514,37 @@ export function getRoutes(permissions) { |
| 281 | 514 | path: 'TestPaperClass', |
| 282 | 515 | name: 'Table', |
| 283 | 516 | component: () => |
| 284 | - import('@/views/TestPaper/TestPaperClass'), | |
| 517 | + import ('@/views/TestPaper/TestPaperClass'), | |
| 285 | 518 | meta: { |
| 286 | 519 | title: '分类管理', |
| 287 | - permissions:['admin' ] | |
| 520 | + permissions: ['admin'] | |
| 288 | 521 | } |
| 289 | 522 | }, { |
| 290 | 523 | path: 'carousel', |
| 291 | 524 | name: 'carousel', |
| 292 | 525 | component: () => |
| 293 | - import('@/views/carousel/index'), | |
| 526 | + import ('@/views/carousel/index'), | |
| 294 | 527 | meta: { |
| 295 | 528 | title: '轮播图', |
| 296 | - permissions:['admin' ] | |
| 529 | + permissions: ['admin'] | |
| 297 | 530 | } |
| 298 | 531 | }, { |
| 299 | 532 | path: 'new', |
| 300 | 533 | name: 'new', |
| 301 | 534 | component: () => |
| 302 | - import('@/views/carousel/new'), | |
| 535 | + import ('@/views/carousel/new'), | |
| 303 | 536 | meta: { |
| 304 | 537 | title: '最新资讯', |
| 305 | - permissions:['admin'] | |
| 538 | + permissions: ['admin'] | |
| 306 | 539 | } |
| 307 | 540 | }] |
| 308 | - }, | |
| 309 | - // 404 page must be placed at the end !!! | |
| 310 | - { | |
| 311 | - path: '*', | |
| 312 | - redirect: '/404', | |
| 313 | - hidden: true | |
| 314 | - } | |
| 315 | - ] | |
| 316 | - } else { | |
| 317 | - return ; | |
| 318 | - constantRoutes1 = [{ | |
| 319 | - path: '/login', | |
| 320 | - component: () => | |
| 321 | - import('@/views/login/index'), | |
| 322 | - hidden: true | |
| 323 | - }, | |
| 324 | - | |
| 325 | - { | |
| 326 | - path: '/404', | |
| 327 | - component: () => | |
| 328 | - import('@/views/404'), | |
| 329 | - hidden: true | |
| 330 | - }, | |
| 331 | - | |
| 332 | - { | |
| 333 | - path: '/example', | |
| 334 | - component: Layout, | |
| 335 | - redirect: '/example/table', | |
| 336 | - name: 'Example', | |
| 337 | - meta: { | |
| 338 | - title: '题库管理', | |
| 339 | - icon: 'el-icon-s-help', | |
| 340 | - permissions: ["admin", "user"], | |
| 341 | - }, | |
| 342 | - children: [{ | |
| 343 | - path: 'QuestionBank', | |
| 344 | - name: 'Table', | |
| 345 | - component: () => | |
| 346 | - import('@/views/QuestionBank/index'), | |
| 347 | - meta: { | |
| 348 | - title: '题库', | |
| 349 | - icon: 'table' | |
| 350 | - } | |
| 351 | - },] | |
| 352 | - }, | |
| 353 | - { | |
| 354 | - path: '/moduleIndex', | |
| 355 | - component: Layout, | |
| 356 | - redirect: '/module/index', | |
| 357 | - name: 'module', | |
| 358 | - meta: { | |
| 359 | - title: '面试题', | |
| 360 | - icon: 'el-icon-s-help' | |
| 361 | - }, | |
| 362 | - children: [{ | |
| 363 | - path: 'recharge', | |
| 364 | - name: 'recharge', | |
| 365 | - component: () => | |
| 366 | - import('@/views/module/index'), | |
| 367 | - meta: { | |
| 368 | - title: '面试题', | |
| 369 | - icon: 'el-icon-s-operation' | |
| 370 | - } | |
| 371 | 541 | }, |
| 542 | + // 404 page must be placed at the end !!! | |
| 372 | 543 | { |
| 373 | - path: 'index', | |
| 374 | - name: 'index', | |
| 375 | - component: () => | |
| 376 | - import('@/views/TestPaper/index'), | |
| 377 | - hidden: true, | |
| 378 | - meta: { | |
| 379 | - title: '试卷维护', | |
| 380 | - icon: 'table' | |
| 381 | - } | |
| 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 | - // }, | |
| 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: () => import('@/views/TestPaper/ManualTestPaper'), | |
| 440 | - // meta: { | |
| 441 | - // title: '组卷', | |
| 442 | - // icon: 'table' | |
| 443 | - // } | |
| 444 | - // }, | |
| 445 | - | |
| 446 | - ] | |
| 447 | - }, | |
| 448 | - // { | |
| 449 | - // path: '/order', | |
| 450 | - // component: Layout, | |
| 451 | - // redirect: '/', | |
| 452 | - // name: 'order', | |
| 453 | - // meta: { | |
| 454 | - // title: '订单管理', | |
| 455 | - // icon: 'el-icon-s-marketing' | |
| 456 | - // }, | |
| 457 | - // children: [{ | |
| 458 | - // path: 'recharge', | |
| 459 | - // name: 'recharge', | |
| 460 | - // component: () => | |
| 461 | - // import('@/views/order/rechargeList'), | |
| 462 | - // meta: { | |
| 463 | - // title: '充值记录', | |
| 464 | - // } | |
| 465 | - // }, { | |
| 466 | - // path: 'shop', | |
| 467 | - // name: 'shop', | |
| 468 | - // component: () => | |
| 469 | - // import('@/views/order/shopList'), | |
| 470 | - // meta: { | |
| 471 | - // title: '购买记录', | |
| 472 | - // } | |
| 473 | - // }] | |
| 474 | - // }, | |
| 475 | - { | |
| 476 | - path: '/user', | |
| 477 | - component: Layout, | |
| 478 | - redirect: '/', | |
| 479 | - name: 'user', | |
| 480 | - meta: { | |
| 481 | - title: '用户管理', | |
| 482 | - icon: 'el-icon-s-help' | |
| 483 | - }, | |
| 484 | - children: [{ | |
| 485 | - path: 'user', | |
| 486 | - name: 'User', | |
| 487 | - component: () => | |
| 488 | - import('@/views/user/userlist'), | |
| 489 | - meta: { | |
| 490 | - title: '人才库', | |
| 491 | - } | |
| 544 | + path: '*', | |
| 545 | + redirect: '/404', | |
| 546 | + hidden: true | |
| 492 | 547 | } |
| 493 | - | |
| 494 | - ] | |
| 495 | - }, { | |
| 496 | - path: '/password', | |
| 497 | - component: Layout, | |
| 498 | - redirect: '/', | |
| 499 | - name: 'password', | |
| 500 | - meta: { | |
| 501 | - title: '系统管理', | |
| 502 | - icon: 'el-icon-s-platform', | |
| 503 | - permissions:['admin','user'] | |
| 504 | - }, | |
| 505 | - children: [{ | |
| 506 | - path: 'index', | |
| 507 | - name: 'index', | |
| 508 | - component: () => | |
| 509 | - import('@/views/password/index'), | |
| 510 | - meta: { | |
| 511 | - title: '忘记密码', | |
| 512 | - } | |
| 513 | - }, { | |
| 514 | - path: 'TestPaperClass', | |
| 515 | - name: 'Table', | |
| 516 | - component: () => | |
| 517 | - import('@/views/TestPaper/TestPaperClass'), | |
| 518 | - meta: { | |
| 519 | - title: '分类管理', | |
| 520 | - permissions: ['admin'] | |
| 521 | - } | |
| 522 | - }, { | |
| 523 | - path: 'carousel', | |
| 524 | - name: 'carousel', | |
| 525 | - component: () => | |
| 526 | - import('@/views/carousel/index'), | |
| 527 | - meta: { | |
| 528 | - title: '轮播图', | |
| 529 | - permissions: ['admin'] | |
| 530 | - } | |
| 531 | - }, { | |
| 532 | - path: 'new', | |
| 533 | - name: 'new', | |
| 534 | - component: () => | |
| 535 | - import('@/views/carousel/new'), | |
| 536 | - meta: { | |
| 537 | - title: '最新资讯', | |
| 538 | - permissions: ['admin'] | |
| 539 | - } | |
| 540 | - }] | |
| 541 | - }, | |
| 542 | - // 404 page must be placed at the end !!! | |
| 543 | - { | |
| 544 | - path: '*', | |
| 545 | - redirect: '/404', | |
| 546 | - hidden: true | |
| 547 | - } | |
| 548 | 548 | ] |
| 549 | 549 | } |
| 550 | 550 | |
| ... | ... | @@ -558,10 +558,10 @@ export function getRoutes(permissions) { |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | |
| 561 | - function filterAsyncRoutes(routes, permissions) { | |
| 561 | + function filterAsyncRoutes(routes, permissions) { | |
| 562 | 562 | const finallyRoutes = []; |
| 563 | 563 | routes.forEach((route) => { |
| 564 | - const item = { ...route }; | |
| 564 | + const item = {...route }; | |
| 565 | 565 | if (hasPermission(permissions, item)) { |
| 566 | 566 | if (item.children) { |
| 567 | 567 | item.children = filterAsyncRoutes(item.children, permissions); |
| ... | ... | @@ -570,7 +570,7 @@ export function getRoutes(permissions) { |
| 570 | 570 | } |
| 571 | 571 | }); |
| 572 | 572 | return finallyRoutes; |
| 573 | - } | |
| 573 | + } | |
| 574 | 574 | constantRoutes1 = filterAsyncRoutes(constantRoutes1, permissions); |
| 575 | 575 | |
| 576 | 576 | return constantRoutes1; | ... | ... |
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,7 +47,7 @@ module.exports = { |
| 47 | 47 | } |
| 48 | 48 | }, |
| 49 | 49 | '/api': { |
| 50 | - target: `http://inteview.t1j2.com/`, //后台服务地址 | |
| 50 | + target: `http://admin.7-stars.com.cn/`, //后台服务地址 | |
| 51 | 51 | // target: 'http://localhost:8877', |
| 52 | 52 | changeOrigin: true, |
| 53 | 53 | pathRewrite: {} | ... | ... |