index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. import Vue from 'vue';
  2. import Router from 'vue-router';
  3. Vue.use(Router);
  4. /* Layout */
  5. import Layout from '@/layout';
  6. /**
  7. * Note: sub-menu only appear when route children.length >= 1
  8. * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
  9. *
  10. * hidden: true if set true, item will not show in the sidebar(default is false)
  11. * alwaysShow: true if set true, will always show the root menu
  12. * if not set alwaysShow, when item has more than one children route,
  13. * it will becomes nested mode, otherwise not show the root menu
  14. * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
  15. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  16. * meta : {
  17. roles: ['admin','editor'] control the page roles (you can set multiple roles)
  18. title: 'title' the name show in sidebar and breadcrumb (recommend set)
  19. icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
  20. breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
  21. activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
  22. }
  23. */
  24. /**
  25. * constantRoutes
  26. * a base page that does not have permission requirements
  27. * all roles can be accessed
  28. */
  29. export const constantRoutes = [
  30. {
  31. path: '/login',
  32. component: () => import('@/views/login/index'),
  33. hidden: true
  34. },
  35. {
  36. path: '/404',
  37. component: () => import('@/views/404'),
  38. hidden: true
  39. },
  40. {
  41. path: '/',
  42. component: Layout,
  43. redirect: '/dashboard',
  44. children: [
  45. {
  46. path: 'dashboard',
  47. name: '主板',
  48. component: () => import('@/views/dashboard/index'),
  49. meta: {
  50. title: '主板',
  51. icon: 'dashboard'
  52. }
  53. }
  54. ]
  55. },
  56. {
  57. path: '/statistics',
  58. component: Layout,
  59. redirect: '/statistics/DownloadImage',
  60. name: '数据统计',
  61. meta: {
  62. title: '数据统计',
  63. icon: 'el-icon-s-help'
  64. },
  65. children: [
  66. {
  67. path: 'DownloadImage',
  68. name: '下载照片',
  69. component: () => import('@/views/statistics/downloadImage/index'),
  70. meta: {
  71. title: '下载照片'
  72. // icon: 'table'
  73. }
  74. },
  75. {
  76. path: 'UploadImage',
  77. name: '上传照片',
  78. component: () => import('@/views/statistics/uploadImage/index'),
  79. meta: {
  80. title: '上传照片'
  81. // icon: 'tree'
  82. }
  83. },
  84. {
  85. path: 'WithdrawalRecord',
  86. name: '提现记录',
  87. component: () => import('@/views/statistics/withdrawalRecord/index'),
  88. meta: {
  89. title: '提现记录'
  90. // icon: 'tree'
  91. }
  92. }
  93. ]
  94. },
  95. {
  96. path: '/photographerManagement',
  97. component: Layout,
  98. redirect: '/photographerManagement/PhotographerVerify',
  99. name: '摄影师',
  100. meta: {
  101. title: '摄影师',
  102. icon: 'el-icon-s-help'
  103. },
  104. children: [
  105. {
  106. path: 'PhotoVerify',
  107. name: '照片管理',
  108. component: () => import('@/views/photographerManagement/photoVerify/index'),
  109. meta: {
  110. title: '照片管理'
  111. // icon: 'tree'
  112. }
  113. }
  114. ]
  115. },
  116. {
  117. path: '/photoManagement',
  118. component: Layout,
  119. redirect: '/photoManagement/ImageGoodsManagement',
  120. name: '图片库管理',
  121. meta: {
  122. title: '图片库管理',
  123. icon: 'el-icon-s-help'
  124. },
  125. children: [
  126. {
  127. path: 'EventsList',
  128. name: '活动列表',
  129. component: () => import('@/views/photoManagement/eventsList/index'),
  130. meta: {
  131. title: '活动列表'
  132. // icon: 'tree'
  133. }
  134. },
  135. {
  136. path: 'ImageGoodsManagement',
  137. name: '照片商品管理',
  138. component: () => import('@/views/photoManagement/imageGoodsManagement/index'),
  139. meta: {
  140. title: '照片商品管理'
  141. // icon: 'table'
  142. }
  143. },
  144. {
  145. path: 'PhotoVerifyManagement',
  146. name: '上传照片管理',
  147. component: () => import('@/views/photoManagement/photoVerifyManagement/index'),
  148. meta: {
  149. title: '上传照片管理'
  150. // icon: 'tree'
  151. }
  152. }
  153. ]
  154. },
  155. {
  156. path: '/certification-management',
  157. component: Layout,
  158. redirect: '/certification-management/PhotographerVerify',
  159. name: '认证管理',
  160. meta: {
  161. title: '认证管理',
  162. icon: 'el-icon-s-help'
  163. },
  164. children: [
  165. {
  166. path: 'PhotographerVerify',
  167. name: '摄影师审核',
  168. component: () => import('@/views/photographerManagement/photographerVerify/index'),
  169. meta: {
  170. title: '摄影师审核'
  171. // icon: 'table'
  172. }
  173. },
  174. {
  175. path: 'SceneVerify',
  176. name: '场景审核',
  177. component: () => import('@/views/sceneManagement/sceneVerify/index'),
  178. meta: {
  179. title: '场景审核'
  180. // icon: 'tree'
  181. }
  182. },
  183. {
  184. path: 'SceneList',
  185. name: '场景列表',
  186. component: () => import('@/views/sceneManagement/sceneList/index'),
  187. meta: {
  188. title: '场景列表'
  189. // icon: 'table'
  190. }
  191. }
  192. ]
  193. },
  194. {
  195. path: '/memberManagement',
  196. component: Layout,
  197. redirect: '/memberManagement/MemberLever',
  198. name: '会员管理',
  199. meta: {
  200. title: '会员管理',
  201. icon: 'el-icon-s-help'
  202. },
  203. children: [
  204. {
  205. path: 'MemberLever',
  206. name: '会员等级',
  207. component: () => import('@/views/memberManagement/memberLever/index'),
  208. meta: {
  209. title: '会员等级'
  210. // icon: 'table'
  211. }
  212. },
  213. {
  214. path: 'MemberList',
  215. name: '会员列表',
  216. component: () => import('@/views/memberManagement/memberList/index'),
  217. meta: {
  218. title: '会员列表'
  219. // icon: 'tree'
  220. }
  221. }
  222. ]
  223. },
  224. {
  225. path: '/financialManagement',
  226. component: Layout,
  227. redirect: '/financialManagement/OrderManagement',
  228. name: '财务管理',
  229. meta: {
  230. title: '财务管理',
  231. icon: 'el-icon-s-help'
  232. },
  233. children: [
  234. {
  235. path: 'OrderManagement',
  236. name: '订单列表',
  237. component: () => import('@/views/financialManagement/orderManagement/index'),
  238. meta: {
  239. title: '订单列表'
  240. // icon: 'table'
  241. }
  242. },
  243. {
  244. path: 'CashDetail',
  245. name: '用户资金明细',
  246. component: () => import('@/views/financialManagement/cashDetail/index'),
  247. meta: {
  248. title: '用户资金明细'
  249. // icon: 'tree'
  250. }
  251. }
  252. ]
  253. },
  254. {
  255. path: '/pointsManagement',
  256. component: Layout,
  257. redirect: '/pointsManagement/PointsDetail',
  258. name: '积分管理',
  259. meta: {
  260. title: '积分管理',
  261. icon: 'el-icon-s-help'
  262. },
  263. children: [
  264. {
  265. path: 'PointsDetail',
  266. name: '积分明细',
  267. component: () => import('@/views/pointsManagement/pointsDetail/index'),
  268. meta: {
  269. title: '积分明细'
  270. // icon: 'table'
  271. }
  272. },
  273. {
  274. path: 'PointsSetting',
  275. name: '积分设置',
  276. component: () => import('@/views/pointsManagement/pointsSetting/index'),
  277. meta: {
  278. title: '积分设置'
  279. // icon: 'tree'
  280. }
  281. }
  282. ]
  283. },
  284. {
  285. path: '/baseManagement',
  286. component: Layout,
  287. redirect: '/baseManagement/BannerManagement',
  288. name: '基础管理',
  289. meta: {
  290. title: '基础管理',
  291. icon: 'el-icon-s-help'
  292. },
  293. children: [
  294. {
  295. path: 'TrendManagement',
  296. name: '热搜词管理',
  297. component: () => import('@/views/baseManagement/trending/index'),
  298. meta: {
  299. title: '热搜词管理'
  300. // icon: 'tree'
  301. }
  302. },
  303. {
  304. path: 'BannerManagement',
  305. name: 'Banner管理',
  306. component: () => import('@/views/baseManagement/bannerManagement/index'),
  307. meta: {
  308. title: 'Banner管理'
  309. // icon: 'table'
  310. }
  311. },
  312. {
  313. path: 'InfoManagement',
  314. name: '资讯管理',
  315. component: () => import('@/views/baseManagement/infoManagement/index'),
  316. meta: {
  317. title: '资讯管理'
  318. // icon: 'tree'
  319. }
  320. },
  321. {
  322. path: 'ProblemFeedbackManagement',
  323. name: '问题管理',
  324. component: () => import('@/views/baseManagement/problemFeedbackManagement/index'),
  325. meta: {
  326. title: '问题管理'
  327. // icon: 'tree'
  328. }
  329. }
  330. ]
  331. },
  332. {
  333. path: '/systemManagement',
  334. component: Layout,
  335. redirect: '/systemManagement/AccountManagement',
  336. name: '系统管理',
  337. meta: {
  338. title: '系统管理',
  339. icon: 'el-icon-s-help'
  340. },
  341. children: [
  342. {
  343. path: 'AccountManagement',
  344. name: '账号列表',
  345. component: () => import('@/views/systemManagement/accountManagement/index'),
  346. meta: {
  347. title: '账号列表'
  348. // icon: 'table'
  349. }
  350. },
  351. {
  352. path: 'RoleManagement',
  353. name: '角色列表',
  354. component: () => import('@/views/systemManagement/roleManagement/index'),
  355. meta: {
  356. title: '角色列表'
  357. // icon: 'tree'
  358. }
  359. }
  360. ]
  361. },
  362. {
  363. path: '/helpInfo',
  364. component: Layout,
  365. redirect: '/helpInfo/IssueType',
  366. name: '帮助信息',
  367. meta: {
  368. title: '帮助信息',
  369. icon: 'el-icon-s-help'
  370. },
  371. children: [
  372. {
  373. path: 'IssueType',
  374. name: '问题分类',
  375. component: () => import('@/views/helpInfo/issueType/index'),
  376. meta: {
  377. title: '问题分类'
  378. // icon: 'table'
  379. }
  380. },
  381. {
  382. path: 'Information',
  383. name: '信息内容',
  384. component: () => import('@/views/helpInfo/information/index'),
  385. meta: {
  386. title: '信息内容'
  387. // icon: 'tree'
  388. }
  389. }
  390. ]
  391. },
  392. // 404 page must be placed at the end !!!
  393. {
  394. path: '*',
  395. redirect: '/404',
  396. hidden: true
  397. }
  398. ];
  399. /**
  400. * asyncRoutes
  401. * the routes that need to be dynamically loaded based on user roles
  402. */
  403. export const asyncRoutes = [
  404. ];
  405. const createRouter = () =>
  406. new Router({
  407. // mode: 'history', // require service support
  408. scrollBehavior: () => ({
  409. y: 0
  410. }),
  411. routes: constantRoutes
  412. });
  413. const router = createRouter();
  414. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  415. export function resetRouter() {
  416. const newRouter = createRouter();
  417. router.matcher = newRouter.matcher; // reset router
  418. }
  419. export default router;