小说后台管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

531 rivejä
12 KiB

  1. // Just a mock data
  2. const constantRoutes = [
  3. {
  4. path: '/redirect',
  5. component: 'layout/Layout',
  6. hidden: true,
  7. children: [
  8. {
  9. path: '/redirect/:path*',
  10. component: 'views/redirect/index'
  11. }
  12. ]
  13. },
  14. {
  15. path: '/login',
  16. component: 'views/login/index',
  17. hidden: true
  18. },
  19. {
  20. path: '/auth-redirect',
  21. component: 'views/login/auth-redirect',
  22. hidden: true
  23. },
  24. {
  25. path: '/404',
  26. component: 'views/error-page/404',
  27. hidden: true
  28. },
  29. {
  30. path: '/401',
  31. component: 'views/error-page/401',
  32. hidden: true
  33. },
  34. {
  35. path: '',
  36. component: 'layout/Layout',
  37. redirect: 'dashboard',
  38. children: [
  39. {
  40. path: 'dashboard',
  41. component: 'views/dashboard/index',
  42. name: 'Dashboard',
  43. meta: { title: 'dashboard', icon: 'dashboard', affix: true }
  44. }
  45. ]
  46. },
  47. {
  48. path: '/documentation',
  49. component: 'layout/Layout',
  50. children: [
  51. {
  52. path: 'index',
  53. component: 'views/documentation/index',
  54. name: 'Documentation',
  55. meta: { title: 'documentation', icon: 'documentation', affix: true }
  56. }
  57. ]
  58. },
  59. {
  60. path: '/guide',
  61. component: 'layout/Layout',
  62. redirect: '/guide/index',
  63. children: [
  64. {
  65. path: 'index',
  66. component: 'views/guide/index',
  67. name: 'Guide',
  68. meta: { title: 'guide', icon: 'guide', noCache: true }
  69. }
  70. ]
  71. }
  72. ]
  73. const asyncRoutes = [
  74. {
  75. path: '/permission',
  76. component: 'layout/Layout',
  77. redirect: '/permission/index',
  78. alwaysShow: true,
  79. meta: {
  80. title: 'permission',
  81. icon: 'lock',
  82. roles: ['admin', 'editor']
  83. },
  84. children: [
  85. {
  86. path: 'page',
  87. component: 'views/permission/page',
  88. name: 'PagePermission',
  89. meta: {
  90. title: 'pagePermission',
  91. roles: ['admin']
  92. }
  93. },
  94. {
  95. path: 'directive',
  96. component: 'views/permission/directive',
  97. name: 'DirectivePermission',
  98. meta: {
  99. title: 'directivePermission'
  100. }
  101. },
  102. {
  103. path: 'role',
  104. component: 'views/permission/role',
  105. name: 'RolePermission',
  106. meta: {
  107. title: 'rolePermission',
  108. roles: ['admin']
  109. }
  110. }
  111. ]
  112. },
  113. {
  114. path: '/icon',
  115. component: 'layout/Layout',
  116. children: [
  117. {
  118. path: 'index',
  119. component: 'views/icons/index',
  120. name: 'Icons',
  121. meta: { title: 'icons', icon: 'icon', noCache: true }
  122. }
  123. ]
  124. },
  125. {
  126. path: '/components',
  127. component: 'layout/Layout',
  128. redirect: 'noRedirect',
  129. name: 'ComponentDemo',
  130. meta: {
  131. title: 'components',
  132. icon: 'component'
  133. },
  134. children: [
  135. {
  136. path: 'tinymce',
  137. component: 'views/components-demo/tinymce',
  138. name: 'TinymceDemo',
  139. meta: { title: 'tinymce' }
  140. },
  141. {
  142. path: 'markdown',
  143. component: 'views/components-demo/markdown',
  144. name: 'MarkdownDemo',
  145. meta: { title: 'markdown' }
  146. },
  147. {
  148. path: 'json-editor',
  149. component: 'views/components-demo/json-editor',
  150. name: 'JsonEditorDemo',
  151. meta: { title: 'jsonEditor' }
  152. },
  153. {
  154. path: 'split-pane',
  155. component: 'views/components-demo/split-pane',
  156. name: 'SplitpaneDemo',
  157. meta: { title: 'splitPane' }
  158. },
  159. {
  160. path: 'avatar-upload',
  161. component: 'views/components-demo/avatar-upload',
  162. name: 'AvatarUploadDemo',
  163. meta: { title: 'avatarUpload' }
  164. },
  165. {
  166. path: 'dropzone',
  167. component: 'views/components-demo/dropzone',
  168. name: 'DropzoneDemo',
  169. meta: { title: 'dropzone' }
  170. },
  171. {
  172. path: 'sticky',
  173. component: 'views/components-demo/sticky',
  174. name: 'StickyDemo',
  175. meta: { title: 'sticky' }
  176. },
  177. {
  178. path: 'count-to',
  179. component: 'views/components-demo/count-to',
  180. name: 'CountToDemo',
  181. meta: { title: 'countTo' }
  182. },
  183. {
  184. path: 'mixin',
  185. component: 'views/components-demo/mixin',
  186. name: 'ComponentMixinDemo',
  187. meta: { title: 'componentMixin' }
  188. },
  189. {
  190. path: 'back-to-top',
  191. component: 'views/components-demo/back-to-top',
  192. name: 'BackToTopDemo',
  193. meta: { title: 'backToTop' }
  194. },
  195. {
  196. path: 'drag-dialog',
  197. component: 'views/components-demo/drag-dialog',
  198. name: 'DragDialogDemo',
  199. meta: { title: 'dragDialog' }
  200. },
  201. {
  202. path: 'drag-select',
  203. component: 'views/components-demo/drag-select',
  204. name: 'DragSelectDemo',
  205. meta: { title: 'dragSelect' }
  206. },
  207. {
  208. path: 'dnd-list',
  209. component: 'views/components-demo/dnd-list',
  210. name: 'DndListDemo',
  211. meta: { title: 'dndList' }
  212. },
  213. {
  214. path: 'drag-kanban',
  215. component: 'views/components-demo/drag-kanban',
  216. name: 'DragKanbanDemo',
  217. meta: { title: 'dragKanban' }
  218. }
  219. ]
  220. },
  221. {
  222. path: '/charts',
  223. component: 'layout/Layout',
  224. redirect: 'noRedirect',
  225. name: 'Charts',
  226. meta: {
  227. title: 'charts',
  228. icon: 'chart'
  229. },
  230. children: [
  231. {
  232. path: 'keyboard',
  233. component: 'views/charts/keyboard',
  234. name: 'KeyboardChart',
  235. meta: { title: 'keyboardChart', noCache: true }
  236. },
  237. {
  238. path: 'line',
  239. component: 'views/charts/line',
  240. name: 'LineChart',
  241. meta: { title: 'lineChart', noCache: true }
  242. },
  243. {
  244. path: 'mixchart',
  245. component: 'views/charts/mixChart',
  246. name: 'MixChart',
  247. meta: { title: 'mixChart', noCache: true }
  248. }
  249. ]
  250. },
  251. {
  252. path: '/nested',
  253. component: 'layout/Layout',
  254. redirect: '/nested/menu1/menu1-1',
  255. name: 'Nested',
  256. meta: {
  257. title: 'nested',
  258. icon: 'nested'
  259. },
  260. children: [
  261. {
  262. path: 'menu1',
  263. component: 'views/nested/menu1/index',
  264. name: 'Menu1',
  265. meta: { title: 'menu1' },
  266. redirect: '/nested/menu1/menu1-1',
  267. children: [
  268. {
  269. path: 'menu1-1',
  270. component: 'views/nested/menu1/menu1-1',
  271. name: 'Menu1-1',
  272. meta: { title: 'menu1-1' }
  273. },
  274. {
  275. path: 'menu1-2',
  276. component: 'views/nested/menu1/menu1-2',
  277. name: 'Menu1-2',
  278. redirect: '/nested/menu1/menu1-2/menu1-2-1',
  279. meta: { title: 'menu1-2' },
  280. children: [
  281. {
  282. path: 'menu1-2-1',
  283. component: 'views/nested/menu1/menu1-2/menu1-2-1',
  284. name: 'Menu1-2-1',
  285. meta: { title: 'menu1-2-1' }
  286. },
  287. {
  288. path: 'menu1-2-2',
  289. component: 'views/nested/menu1/menu1-2/menu1-2-2',
  290. name: 'Menu1-2-2',
  291. meta: { title: 'menu1-2-2' }
  292. }
  293. ]
  294. },
  295. {
  296. path: 'menu1-3',
  297. component: 'views/nested/menu1/menu1-3',
  298. name: 'Menu1-3',
  299. meta: { title: 'menu1-3' }
  300. }
  301. ]
  302. },
  303. {
  304. path: 'menu2',
  305. name: 'Menu2',
  306. component: 'views/nested/menu2/index',
  307. meta: { title: 'menu2' }
  308. }
  309. ]
  310. },
  311. {
  312. path: '/example',
  313. component: 'layout/Layout',
  314. redirect: '/example/list',
  315. name: 'Example',
  316. meta: {
  317. title: 'example',
  318. icon: 'example'
  319. },
  320. children: [
  321. {
  322. path: 'create',
  323. component: 'views/example/create',
  324. name: 'CreateArticle',
  325. meta: { title: 'createArticle', icon: 'edit' }
  326. },
  327. {
  328. path: 'edit/:id(\\d+)',
  329. component: 'views/example/edit',
  330. name: 'EditArticle',
  331. meta: { title: 'editArticle', noCache: true },
  332. hidden: true
  333. },
  334. {
  335. path: 'list',
  336. component: 'views/example/list',
  337. name: 'ArticleList',
  338. meta: { title: 'articleList', icon: 'list' }
  339. }
  340. ]
  341. },
  342. {
  343. path: '/tab',
  344. component: 'layout/Layout',
  345. children: [
  346. {
  347. path: 'index',
  348. component: 'views/tab/index',
  349. name: 'Tab',
  350. meta: { title: 'tab', icon: 'tab' }
  351. }
  352. ]
  353. },
  354. {
  355. path: '/error',
  356. component: 'layout/Layout',
  357. redirect: 'noRedirect',
  358. name: 'ErrorPages',
  359. meta: {
  360. title: 'errorPages',
  361. icon: '404'
  362. },
  363. children: [
  364. {
  365. path: '401',
  366. component: 'views/error-page/401',
  367. name: 'Page401',
  368. meta: { title: 'page401', noCache: true }
  369. },
  370. {
  371. path: '404',
  372. component: 'views/error-page/404',
  373. name: 'Page404',
  374. meta: { title: 'page404', noCache: true }
  375. }
  376. ]
  377. },
  378. {
  379. path: '/error-log',
  380. component: 'layout/Layout',
  381. redirect: 'noRedirect',
  382. children: [
  383. {
  384. path: 'log',
  385. component: 'views/error-log/index',
  386. name: 'ErrorLog',
  387. meta: { title: 'errorLog', icon: 'bug' }
  388. }
  389. ]
  390. },
  391. {
  392. path: '/excel',
  393. component: 'layout/Layout',
  394. redirect: '/excel/export-excel',
  395. name: 'Excel',
  396. meta: {
  397. title: 'excel',
  398. icon: 'excel'
  399. },
  400. children: [
  401. {
  402. path: 'export-excel',
  403. component: 'views/excel/export-excel',
  404. name: 'ExportExcel',
  405. meta: { title: 'exportExcel' }
  406. },
  407. {
  408. path: 'export-selected-excel',
  409. component: 'views/excel/select-excel',
  410. name: 'SelectExcel',
  411. meta: { title: 'selectExcel' }
  412. },
  413. {
  414. path: 'export-merge-header',
  415. component: 'views/excel/merge-header',
  416. name: 'MergeHeader',
  417. meta: { title: 'mergeHeader' }
  418. },
  419. {
  420. path: 'upload-excel',
  421. component: 'views/excel/upload-excel',
  422. name: 'UploadExcel',
  423. meta: { title: 'uploadExcel' }
  424. }
  425. ]
  426. },
  427. {
  428. path: '/zip',
  429. component: 'layout/Layout',
  430. redirect: '/zip/download',
  431. alwaysShow: true,
  432. meta: { title: 'zip', icon: 'zip' },
  433. children: [
  434. {
  435. path: 'download',
  436. component: 'views/zip/index',
  437. name: 'ExportZip',
  438. meta: { title: 'exportZip' }
  439. }
  440. ]
  441. },
  442. {
  443. path: '/pdf',
  444. component: 'layout/Layout',
  445. redirect: '/pdf/index',
  446. children: [
  447. {
  448. path: 'index',
  449. component: 'views/pdf/index',
  450. name: 'PDF',
  451. meta: { title: 'pdf', icon: 'pdf' }
  452. }
  453. ]
  454. },
  455. {
  456. path: '/pdf/download',
  457. component: 'views/pdf/download',
  458. hidden: true
  459. },
  460. {
  461. path: '/theme',
  462. component: 'layout/Layout',
  463. redirect: 'noRedirect',
  464. children: [
  465. {
  466. path: 'index',
  467. component: 'views/theme/index',
  468. name: 'Theme',
  469. meta: { title: 'theme', icon: 'theme' }
  470. }
  471. ]
  472. },
  473. {
  474. path: '/clipboard',
  475. component: 'layout/Layout',
  476. redirect: 'noRedirect',
  477. children: [
  478. {
  479. path: 'index',
  480. component: 'views/clipboard/index',
  481. name: 'ClipboardDemo',
  482. meta: { title: 'clipboardDemo', icon: 'clipboard' }
  483. }
  484. ]
  485. },
  486. {
  487. path: '/i18n',
  488. component: 'layout/Layout',
  489. children: [
  490. {
  491. path: 'index',
  492. component: 'views/i18n-demo/index',
  493. name: 'I18n',
  494. meta: { title: 'i18n', icon: 'international' }
  495. }
  496. ]
  497. },
  498. {
  499. path: 'external-link',
  500. component: 'layout/Layout',
  501. children: [
  502. {
  503. path: 'https://github.com/PanJiaChen/vue-element-admin',
  504. meta: { title: 'externalLink', icon: 'link' }
  505. }
  506. ]
  507. },
  508. { path: '*', redirect: '/404', hidden: true }
  509. ]
  510. module.exports = {
  511. constantRoutes,
  512. asyncRoutes
  513. }