router.config.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. // eslint-disable-next-line
  2. import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView } from '@/layouts'
  3. // import { bxAnaalyse } from '@/core/icons'
  4. export const asyncRouterMap = [
  5. {
  6. path: '/',
  7. name: 'index',
  8. component: BasicLayout,
  9. meta: { title: '首页' },
  10. redirect: '/author/list',
  11. children: [
  12. // dashboard
  13. // {
  14. // path: '/dashboard',
  15. // name: 'dashboard',
  16. // redirect: '/dashboard/analysis',
  17. // component: RouteView,
  18. // meta: { title: '仪表盘', keepAlive: true, icon: bxAnaalyse, permission: [ 'dashboard' ] },
  19. // children: [
  20. // {
  21. // path: '/dashboard/analysis',
  22. // name: 'Analysis',
  23. // component: () => import('@/views/dashboard/Analysis'),
  24. // meta: { title: '分析页', keepAlive: false, permission: [ 'dashboard' ] }
  25. // }
  26. // ]
  27. // },
  28. // forms
  29. {
  30. path: '/author',
  31. redirect: '/author/list',
  32. component: PageView,
  33. meta: { title: '作者', icon: 'form' },
  34. children: [
  35. {
  36. path: '/author/list',
  37. name: 'AuthorList',
  38. component: () => import('@/views/author/AuthorList'),
  39. meta: { title: '作者列表', keepAlive: false }
  40. }
  41. ]
  42. },
  43. {
  44. path: '/article',
  45. redirect: '/article/list',
  46. component: PageView,
  47. meta: { title: '文章管理', icon: 'form' },
  48. children: [
  49. {
  50. path: '/article/list',
  51. name: 'ArticleList',
  52. component: () => import('@/views/article/ArticleList'),
  53. meta: { title: '文章列表', keepAlive: false }
  54. },
  55. {
  56. path: '/tags/list',
  57. name: 'TagsList',
  58. component: () => import('@/views/tags/TagsList'),
  59. meta: { title: '标签列表', keepAlive: false }
  60. },
  61. {
  62. path: '/category/list',
  63. name: 'CategoryList',
  64. component: () => import('@/views/category/CategoryList'),
  65. meta: { title: '分类列表', keepAlive: false }
  66. },
  67. {
  68. path: '/comment/list',
  69. name: 'CommentList',
  70. component: () => import('@/views/comment/CommentList'),
  71. meta: { title: '评论管理', keepAlive: false }
  72. }
  73. ]
  74. },
  75. // user
  76. {
  77. path: '/auth',
  78. redirect: '/auth/list',
  79. component: PageView,
  80. meta: { title: '用户管理', icon: 'team' },
  81. children: [
  82. {
  83. path: '/user/list',
  84. name: 'userList',
  85. component: () => import('@/views/auth/UserList'),
  86. meta: { title: '用户列表', keepAlive: false }
  87. }
  88. ]
  89. },
  90. // account
  91. {
  92. path: '/account',
  93. component: RouteView,
  94. redirect: '/account/settings',
  95. name: 'account',
  96. meta: { title: '个人页', icon: 'user', keepAlive: true, permission: [ 'user' ] },
  97. children: [
  98. {
  99. path: '/account/settings',
  100. name: 'settings',
  101. component: () => import('@/views/account/settings/Index'),
  102. meta: { title: '个人设置', hideHeader: true, permission: [ 'user' ] },
  103. redirect: '/account/settings/base',
  104. hideChildrenInMenu: true,
  105. children: [
  106. {
  107. path: '/account/settings/base',
  108. name: 'BaseSettings',
  109. component: () => import('@/views/account/settings/BaseSetting'),
  110. meta: { title: '基本设置', permission: [ 'user' ] }
  111. },
  112. {
  113. path: '/account/settings/password',
  114. name: 'UpdatePassword',
  115. component: () => import('@/views/account/settings/UpdatePassword'),
  116. meta: { title: '修改密码', keepAlive: true, permission: [ 'user' ] }
  117. }
  118. ]
  119. }
  120. ]
  121. }
  122. ]
  123. },
  124. {
  125. path: '*', redirect: '/404', hidden: true
  126. }
  127. ]
  128. /**
  129. * 基础路由
  130. * @type { *[] }
  131. */
  132. export const constantRouterMap = [
  133. {
  134. path: '/user',
  135. component: UserLayout,
  136. redirect: '/user/login',
  137. hidden: true,
  138. children: [
  139. {
  140. path: 'login',
  141. name: 'login',
  142. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
  143. },
  144. {
  145. path: 'register',
  146. name: 'register',
  147. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
  148. },
  149. {
  150. path: 'register-result',
  151. name: 'registerResult',
  152. component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
  153. },
  154. {
  155. path: 'recover',
  156. name: 'recover',
  157. component: undefined
  158. }
  159. ]
  160. },
  161. {
  162. path: '/test',
  163. component: BlankLayout,
  164. redirect: '/test/home',
  165. children: [
  166. {
  167. path: 'home',
  168. name: 'TestHome',
  169. component: () => import('@/views/Home')
  170. }
  171. ]
  172. },
  173. {
  174. path: '/404',
  175. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  176. }
  177. ]