router.config.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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: '/dashboard/analysis',
  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: '/article',
  31. redirect: '/article/list',
  32. component: PageView,
  33. meta: { title: '文章管理', icon: 'form' },
  34. children: [
  35. {
  36. path: '/article/list',
  37. name: 'ArticleList',
  38. component: () => import('@/views/article/ArticleList'),
  39. meta: { title: '文章列表', keepAlive: false }
  40. },
  41. {
  42. path: '/tags/list',
  43. name: 'TagsList',
  44. component: () => import('@/views/tags/TagsList'),
  45. meta: { title: '标签列表', keepAlive: false }
  46. },
  47. {
  48. path: '/category/list',
  49. name: 'CategoryList',
  50. component: () => import('@/views/category/CategoryList'),
  51. meta: { title: '分类列表', keepAlive: false }
  52. },
  53. {
  54. path: '/comment/list',
  55. name: 'CommentList',
  56. component: () => import('@/views/comment/CommentList'),
  57. meta: { title: '评论管理', keepAlive: false }
  58. }
  59. ]
  60. },
  61. // links
  62. {
  63. path: '/links',
  64. redirect: '/links/list',
  65. component: PageView,
  66. meta: { title: '友链管理', icon: 'share-alt' },
  67. children: [
  68. {
  69. path: '/links/list',
  70. name: 'LinksList',
  71. component: () => import('@/views/links/LinksList'),
  72. meta: { title: '友链列表', keepAlive: false }
  73. }
  74. ]
  75. },
  76. // user
  77. {
  78. path: '/auth',
  79. redirect: '/auth/list',
  80. component: PageView,
  81. meta: { title: '用户管理', icon: 'team' },
  82. children: [
  83. {
  84. path: '/user/list',
  85. name: 'userList',
  86. component: () => import('@/views/auth/UserList'),
  87. meta: { title: '用户列表', keepAlive: false }
  88. }
  89. ]
  90. },
  91. // logs
  92. {
  93. path: '/logs',
  94. redirect: '/logs/list',
  95. component: PageView,
  96. meta: { title: '日志管理', icon: 'snippets' },
  97. children: [
  98. {
  99. path: '/logs/list',
  100. name: 'logsList',
  101. component: () => import('@/views/logs/LogsList'),
  102. meta: { title: '日志列表', keepAlive: false }
  103. }
  104. ]
  105. },
  106. // menu
  107. {
  108. path: '/menu',
  109. redirect: '/menu/list',
  110. component: PageView,
  111. meta: { title: '菜单管理', icon: 'snippets' },
  112. children: [
  113. {
  114. path: '/menu/list',
  115. name: 'menuList',
  116. component: () => import('@/views/menu/MenuList'),
  117. meta: { title: '菜单列表', keepAlive: false }
  118. }
  119. ]
  120. },
  121. // social
  122. {
  123. path: '/social',
  124. redirect: '/social/list',
  125. component: PageView,
  126. meta: { title: '社交管理', icon: 'snippets' },
  127. children: [
  128. {
  129. path: '/social/list',
  130. name: 'socialList',
  131. component: () => import('@/views/social/SocialList'),
  132. meta: { title: '社交列表', keepAlive: false }
  133. }
  134. ]
  135. },
  136. // config
  137. {
  138. path: '/config',
  139. redirect: '/config/list',
  140. component: PageView,
  141. meta: { title: '系统配置', icon: 'tool' },
  142. children: [
  143. {
  144. path: '/config/site',
  145. name: 'BasicForm',
  146. component: () => import('@/views/config/BasicForm'),
  147. meta: { title: '站点信息', keepAlive: false }
  148. },
  149. {
  150. path: '/config/file',
  151. redirect: '/config/list/file',
  152. component: RouteView,
  153. meta: { title: '文件存储配置', keepAlive: false },
  154. children: [
  155. {
  156. path: '/config/default/oss',
  157. name: 'DefaultForm',
  158. component: () => import('@/views/config/file/DefaultForm'),
  159. meta: { title: '服务器OSS配置', keepAlive: false }
  160. },
  161. {
  162. path: '/config/qiniu/oss',
  163. name: 'QnyForm',
  164. component: () => import('@/views/config/file/QnyForm'),
  165. meta: { title: '七牛云OSS配置', keepAlive: false }
  166. },
  167. {
  168. path: '/config/aliyun/oss',
  169. name: 'ALiYunOSSFrom',
  170. component: () => import('@/views/config/file/ALiYunOSSForm'),
  171. meta: { title: '阿里云OSS配置', keepAlive: false }
  172. },
  173. {
  174. path: '/config/cos/oss',
  175. name: 'COSForm',
  176. component: () => import('@/views/config/file/COSForm'),
  177. meta: { title: '腾讯云COS配置', keepAlive: false }
  178. }
  179. ]
  180. },
  181. {
  182. path: '/config/cloudMusic',
  183. name: 'cloudMusicForm',
  184. component: () => import('@/views/config/MusicForm'),
  185. meta: { title: '歌单配置', keepAlive: false }
  186. }
  187. ]
  188. },
  189. // account
  190. {
  191. path: '/account',
  192. component: RouteView,
  193. redirect: '/account/settings',
  194. name: 'account',
  195. meta: { title: '个人页', icon: 'user', keepAlive: true, permission: [ 'user' ] },
  196. children: [
  197. {
  198. path: '/account/settings',
  199. name: 'settings',
  200. component: () => import('@/views/account/settings/Index'),
  201. meta: { title: '个人设置', hideHeader: true, permission: [ 'user' ] },
  202. redirect: '/account/settings/base',
  203. hideChildrenInMenu: true,
  204. children: [
  205. {
  206. path: '/account/settings/base',
  207. name: 'BaseSettings',
  208. component: () => import('@/views/account/settings/BaseSetting'),
  209. meta: { title: '基本设置', permission: [ 'user' ] }
  210. },
  211. {
  212. path: '/account/settings/password',
  213. name: 'UpdatePassword',
  214. component: () => import('@/views/account/settings/UpdatePassword'),
  215. meta: { title: '修改密码', keepAlive: true, permission: [ 'user' ] }
  216. }
  217. ]
  218. }
  219. ]
  220. }
  221. ]
  222. },
  223. {
  224. path: '*', redirect: '/404', hidden: true
  225. }
  226. ]
  227. /**
  228. * 基础路由
  229. * @type { *[] }
  230. */
  231. export const constantRouterMap = [
  232. {
  233. path: '/user',
  234. component: UserLayout,
  235. redirect: '/user/login',
  236. hidden: true,
  237. children: [
  238. {
  239. path: 'login',
  240. name: 'login',
  241. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
  242. },
  243. {
  244. path: 'register',
  245. name: 'register',
  246. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
  247. },
  248. {
  249. path: 'register-result',
  250. name: 'registerResult',
  251. component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
  252. },
  253. {
  254. path: 'recover',
  255. name: 'recover',
  256. component: undefined
  257. }
  258. ]
  259. },
  260. {
  261. path: '/test',
  262. component: BlankLayout,
  263. redirect: '/test/home',
  264. children: [
  265. {
  266. path: 'home',
  267. name: 'TestHome',
  268. component: () => import('@/views/Home')
  269. }
  270. ]
  271. },
  272. {
  273. path: '/404',
  274. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  275. }
  276. ]