index.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  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. // path: '/login',
  31. // component: () => import('@/views/login/index'),
  32. // hidden: true
  33. // },
  34. // {
  35. // path: '/404',
  36. // component: () => import('@/views/404'),
  37. // hidden: true
  38. // },
  39. // // 商家管理
  40. // {
  41. // path: '/',
  42. // component: Layout,
  43. // redirect: '/businessList',
  44. // meta: {
  45. // title: '商家管理',
  46. // icon: 'el-icon-s-help'
  47. // },
  48. // children: [{
  49. // path: 'businessList',
  50. // name: 'businessList',
  51. // component: () => import('@/views/business/businessList/index'),
  52. // meta: {
  53. // title: '商家列表',
  54. // icon: 'table'
  55. // }
  56. // },
  57. // {
  58. // path: 'settlement',
  59. // name: 'settlement',
  60. // component: () => import('@/views/business/settlement/index'),
  61. // meta: {
  62. // title: '入驻申请',
  63. // icon: 'tree'
  64. // }
  65. // },
  66. // {
  67. // hidden: true,
  68. // path: 'addSettlement',
  69. // name: 'addSettlement',
  70. // component: () => import('@/views/business/settlement/addSettlement'),
  71. // meta: {
  72. // title: '入驻申请详情',
  73. // icon: 'tree'
  74. // }
  75. // }
  76. // ]
  77. // },
  78. // // 平台装修
  79. // {
  80. // path: '/renovation',
  81. // component: Layout,
  82. // name: 'renovation',
  83. // meta: {
  84. // title: '平台装修',
  85. // icon: 'el-icon-s-help'
  86. // },
  87. // children: [{
  88. // path: 'wechatApp',
  89. // name: 'wechatApp',
  90. // component: () => import('@/views/renovation/wechatApp/index'),
  91. // meta: {
  92. // title: '小程序',
  93. // icon: 'table'
  94. // }
  95. // },
  96. // {
  97. // path: 'custom',
  98. // name: 'custom',
  99. // component: () => import('@/views/renovation/custom/index'),
  100. // meta: {
  101. // title: '自定义页面',
  102. // icon: 'tree'
  103. // }
  104. // },
  105. // {
  106. // path: 'commdityClass',
  107. // name: 'commdityClass',
  108. // component: () => import('@/views/renovation/commdityClass/index'),
  109. // meta: {
  110. // title: '商品类别',
  111. // icon: 'tree'
  112. // }
  113. // },
  114. // {
  115. // path: 'commoditySystem',
  116. // name: 'commoditySystem',
  117. // component: () => import('@/views/renovation/commoditySystem/index'),
  118. // meta: {
  119. // title: '商品管理',
  120. // icon: 'tree'
  121. // }
  122. // },
  123. // {
  124. // hidden: true, // (默认 false)
  125. // path: 'addCommodity',
  126. // name: 'addCommodity',
  127. // component: () => import('@/views/renovation/commoditySystem/addCommodity'),
  128. // meta: {
  129. // title: '查看详情',
  130. // icon: 'table'
  131. // }
  132. // }
  133. // ]
  134. // },
  135. // // 平台活动
  136. // {
  137. // path: '/active',
  138. // component: Layout,
  139. // redirect: '/active/seckilllist',
  140. // meta: {
  141. // title: '平台活动',
  142. // icon: 'el-icon-s-help'
  143. // },
  144. // children: [
  145. // // {
  146. // // path: '/active/index',
  147. // // name: 'active',
  148. // // component: () => import('@/views/active/index'),
  149. // // meta: {
  150. // // title: '平台活动',
  151. // // icon: 'dashboard'
  152. // // }
  153. // // },
  154. // // {
  155. // // hidden: true,
  156. // // path: '/active/add',
  157. // // name: 'addActive',
  158. // // component: () => import('@/views/active/addActive'),
  159. // // meta: {
  160. // // title: '新增活动',
  161. // // icon: 'dashboard'
  162. // // }
  163. // // },
  164. // // {
  165. // // hidden: true,
  166. // // path: '/active/activeDetails',
  167. // // name: 'activeDetails',
  168. // // component: () => import('@/views/active/activeDetails'),
  169. // // meta: {
  170. // // title: '活动详情',
  171. // // icon: 'dashboard'
  172. // // }
  173. // // },
  174. // {
  175. // path: '/active/couponlist',
  176. // name: 'couponlist',
  177. // component: () => import('@/views/active/coupon/index.vue'),
  178. // meta: {
  179. // title: '优惠券活动',
  180. // icon: 'dashboard'
  181. // }
  182. // },
  183. // {
  184. // hidden: true,
  185. // path: '/active/couponlist/add',
  186. // name: 'couponlistAdd',
  187. // component: () => import('@/views/active/coupon/couponAdd.vue'),
  188. // meta: {
  189. // title: '新增优惠券活动',
  190. // icon: 'dashboard'
  191. // }
  192. // },
  193. // {
  194. // hidden: true,
  195. // path: '/active/couponlist/couponDetail',
  196. // name: 'couponDetail',
  197. // component: () => import('@/views/active/coupon/couponDetail.vue'),
  198. // meta: {
  199. // title: '优惠券活动详情',
  200. // icon: 'dashboard'
  201. // }
  202. // },
  203. // {
  204. // path: '/active/seckilllist',
  205. // name: 'seckilllist',
  206. // component: () => import('@/views/active/seckill/index.vue'),
  207. // meta: {
  208. // title: '秒杀活动',
  209. // icon: 'dashboard'
  210. // }
  211. // },
  212. // {
  213. // hidden: true,
  214. // path: '/active/seckilllist/add',
  215. // name: 'seckilllistAdd',
  216. // component: () => import('@/views/active/seckill/seckillAdd.vue'),
  217. // meta: {
  218. // title: '新增秒杀活动',
  219. // icon: 'dashboard'
  220. // }
  221. // },
  222. // {
  223. // hidden: true,
  224. // path: '/active/seckilllist/seckillDetail',
  225. // name: 'seckillDetail',
  226. // component: () => import('@/views/active/seckill/seckillDetail.vue'),
  227. // meta: {
  228. // title: '秒杀活动详情',
  229. // icon: 'dashboard'
  230. // }
  231. // },
  232. // {
  233. // path: '/active/discountlist',
  234. // name: 'discountlist',
  235. // component: () => import('@/views/active/discount/index.vue'),
  236. // meta: {
  237. // title: '限时折扣',
  238. // icon: 'dashboard'
  239. // }
  240. // },
  241. // {
  242. // hidden: true,
  243. // path: '/active/discount/add',
  244. // name: 'discountAdd',
  245. // component: () => import('@/views/active/discount/discountAdd.vue'),
  246. // meta: {
  247. // title: '新增折扣活动',
  248. // icon: 'dashboard'
  249. // }
  250. // },
  251. // {
  252. // hidden: true,
  253. // path: '/active/discount/discountDetail',
  254. // name: 'discountDetail',
  255. // component: () => import('@/views/active/discount/discountDetail.vue'),
  256. // meta: {
  257. // title: '折扣活动详情',
  258. // icon: 'dashboard'
  259. // }
  260. // },
  261. // {
  262. // path: '/active/politelist',
  263. // name: 'politelist',
  264. // component: () => import('@/views/active/polite/index.vue'),
  265. // meta: {
  266. // title: '支付有礼',
  267. // icon: 'dashboard'
  268. // }
  269. // },
  270. // {
  271. // hidden: true,
  272. // path: '/active/politelist/add',
  273. // name: 'politelistAdd',
  274. // component: () => import('@/views/active/polite/politeAdd.vue'),
  275. // meta: {
  276. // title: '新增支付有礼活动',
  277. // icon: 'dashboard'
  278. // }
  279. // },
  280. // {
  281. // hidden: true,
  282. // path: '/active/politelist/politeDetail',
  283. // name: 'politeDetail',
  284. // component: () => import('@/views/active/polite/politeDetail.vue'),
  285. // meta: {
  286. // title: '支付有礼活动详情',
  287. // icon: 'dashboard'
  288. // }
  289. // }
  290. // ]
  291. // },
  292. // // Redis延时任务
  293. // {
  294. // path: '/pay',
  295. // component: Layout,
  296. // children: [{
  297. // path: '/',
  298. // name: 'pay',
  299. // component: () => import('@/views/pay/index'),
  300. // meta: {
  301. // title: 'Redis延时任务',
  302. // icon: 'dashboard'
  303. // }
  304. // }]
  305. // },
  306. // // 财务
  307. // {
  308. // path: '/finance',
  309. // component: Layout,
  310. // meta: {
  311. // title: '财务',
  312. // icon: 'dashboard'
  313. // },
  314. // children: [{
  315. // path: 'withdrawal',
  316. // name: 'withdrawal',
  317. // component: () => import('@/views/finance/withdrawal/index'),
  318. // meta: {
  319. // title: '提现申请',
  320. // icon: 'dashboard'
  321. // }
  322. // },
  323. // {
  324. // path: 'overview',
  325. // name: 'overview',
  326. // component: () => import('@/views/finance/overview/index'),
  327. // meta: {
  328. // title: '财务概况',
  329. // icon: 'dashboard'
  330. // }
  331. // },
  332. // {
  333. // path: 'bond',
  334. // name: 'bond',
  335. // component: () => import('@/views/finance/bond/index'),
  336. // meta: {
  337. // title: '财务概况',
  338. // icon: 'dashboard'
  339. // }
  340. // },
  341. // {
  342. // path: 'application',
  343. // name: 'application',
  344. // component: () => import('@/views/finance/application/index'),
  345. // meta: {
  346. // title: '用户提现申请',
  347. // icon: 'dashboard'
  348. // }
  349. // }
  350. // ]
  351. // },
  352. // // {
  353. // // path: '/after',
  354. // // component: Layout,
  355. // // children: [{
  356. // // path: 'after',
  357. // // name: 'after',
  358. // // component: () => import('@/views/after/index'),
  359. // // meta: {
  360. // // title: '售后处理',
  361. // // icon: 'dashboard'
  362. // // }
  363. // // },
  364. // // {
  365. // // path: 'afterDetails',
  366. // // name: 'afterDetails',
  367. // // component: () => import('@/views/after/details'),
  368. // // meta: {
  369. // // title: '售后详情',
  370. // // icon: 'dashboard'
  371. // // }
  372. // // }
  373. // // ]
  374. // // },
  375. // // 订单
  376. // {
  377. // path: '/order',
  378. // component: Layout,
  379. // redirect: '/order',
  380. // name: 'order',
  381. // meta: {
  382. // title: '订单',
  383. // icon: 'el-icon-s-help'
  384. // },
  385. // children: [{
  386. // path: 'pending',
  387. // name: 'pending',
  388. // component: () => import('@/views/order/pending/index'),
  389. // meta: {
  390. // title: '待处理订单',
  391. // icon: 'table'
  392. // }
  393. // },
  394. // // pendDetails
  395. // {
  396. // hidden: true, // (默认 false)
  397. // path: 'pendDetails',
  398. // name: 'pendDetails',
  399. // component: () => import('@/views/order/pending/pendDetails'),
  400. // meta: {
  401. // title: '订单详情',
  402. // icon: 'table'
  403. // }
  404. // },
  405. // {
  406. // path: 'after',
  407. // name: 'after',
  408. // component: () => import('@/views/order/after/index'),
  409. // meta: {
  410. // title: '售后处理',
  411. // icon: 'dashboard'
  412. // }
  413. // },
  414. // {
  415. // path: 'afterDetails',
  416. // name: 'afterDetails',
  417. // component: () => import('@/views/order/after/details'),
  418. // meta: {
  419. // title: '售后详情',
  420. // icon: 'dashboard'
  421. // }
  422. // }
  423. // ]
  424. // },
  425. // // {
  426. // // path: '/system',
  427. // // component: Layout,
  428. // // children: [{
  429. // // hidden: true, // (默认 false)
  430. // // path: '/system/editShopSys',
  431. // // component: () => import('@/views/system/shopSys/edit'), // Parent router-view
  432. // // name: 'editShopSys',
  433. // // meta: {
  434. // // title: '编辑店铺信息'
  435. // // },
  436. // // },
  437. // // {
  438. // // path: '/system/shopSys',
  439. // // component: () => import('@/views/system/shopSys/index'), // Parent router-view
  440. // // name: 'dict',
  441. // // meta: {
  442. // // title: '店铺设置',
  443. // // icon: 'dashboard'
  444. // // },
  445. // // },
  446. // // ]
  447. // // },
  448. // // 评论
  449. // {
  450. // path: '/comment',
  451. // component: Layout,
  452. // redirect: '/comment/commentSys',
  453. // name: 'comment',
  454. // meta: {
  455. // title: '评论',
  456. // icon: 'el-icon-s-help'
  457. // },
  458. // children: [{
  459. // path: 'commentSys',
  460. // name: 'commentSys',
  461. // component: () => import('@/views/comment/commentSys/index'),
  462. // meta: {
  463. // title: '评论管理',
  464. // icon: 'tree'
  465. // }
  466. // },
  467. // {
  468. // path: 'sensitive',
  469. // name: 'sensitive',
  470. // component: () => import('@/views/comment/sensitive/index'),
  471. // meta: {
  472. // title: '敏感词管理',
  473. // icon: 'table'
  474. // }
  475. // },
  476. // {
  477. // path: 'keyWord',
  478. // name: 'keyWord',
  479. // component: () => import('@/views/comment/keyword/index'),
  480. // meta: {
  481. // title: '关键词管理',
  482. // icon: 'tree'
  483. // }
  484. // }
  485. // ]
  486. // },
  487. // // 客户管理
  488. // {
  489. // path: '/customer',
  490. // component: Layout,
  491. // redirect: '/customer/customerMage',
  492. // name: 'customer',
  493. // meta: {
  494. // title: '客户管理',
  495. // icon: 'el-icon-s-help'
  496. // },
  497. // children: [{
  498. // path: 'customerMage',
  499. // name: 'customerMage',
  500. // component: () => import('@/views/customer/customerMage/index'),
  501. // meta: {
  502. // title: '客户管理',
  503. // icon: 'table'
  504. // }
  505. // },
  506. // {
  507. // hidden: true,
  508. // path: 'customerDetails',
  509. // name: 'customerDetails',
  510. // component: () => import('@/views/customer/customerMage/customerDetails'),
  511. // meta: {
  512. // title: '客户详情',
  513. // icon: 'table'
  514. // }
  515. // },
  516. // {
  517. // path: 'tips',
  518. // name: 'tips',
  519. // component: () => import('@/views/customer/tips/index'),
  520. // meta: {
  521. // title: '标签管理',
  522. // icon: 'tree'
  523. // }
  524. // },
  525. // {
  526. // hidden: true,
  527. // path: 'addTips',
  528. // name: 'addTips',
  529. // component: () => import('@/views/customer/tips/addTips'),
  530. // meta: {
  531. // title: '创建标签',
  532. // icon: 'tree'
  533. // }
  534. // }
  535. // ]
  536. // },
  537. // // 系统管理
  538. // {
  539. // path: '/setup',
  540. // component: Layout,
  541. // redirect: '/setup/user',
  542. // name: 'setup',
  543. // meta: {
  544. // title: '系统管理',
  545. // icon: 'el-icon-s-help'
  546. // },
  547. // children: [{
  548. // path: 'user',
  549. // name: 'user',
  550. // component: () => import('@/views/setup/user/index'),
  551. // meta: {
  552. // title: '用户管理',
  553. // icon: 'table'
  554. // }
  555. // },
  556. // {
  557. // path: 'role',
  558. // name: 'role',
  559. // component: () => import('@/views/setup/role/index'),
  560. // meta: {
  561. // title: '角色管理',
  562. // icon: 'tree'
  563. // }
  564. // },
  565. // {
  566. // path: 'tabs',
  567. // name: 'tabs',
  568. // component: () => import('@/views/setup/tabs/index'),
  569. // meta: {
  570. // title: '菜单管理',
  571. // icon: 'tree'
  572. // }
  573. // },
  574. // {
  575. // path: 'businessMenus',
  576. // name: 'businessMenus',
  577. // component: () => import('@/views/setup/businessMenus/index'),
  578. // meta: {
  579. // title: '商家菜单',
  580. // icon: 'tree'
  581. // }
  582. // },
  583. // {
  584. // path: 'dict',
  585. // name: 'dict',
  586. // component: () => import('@/views/setup/dict/index'),
  587. // meta: {
  588. // title: '字典管理',
  589. // icon: 'tree'
  590. // }
  591. // }
  592. // ]
  593. // },
  594. // // 消息中心
  595. // {
  596. // path: '/notice',
  597. // component: Layout,
  598. // redirect: '/notice/history',
  599. // name: 'notice',
  600. // meta: {
  601. // title: '消息中心',
  602. // icon: 'el-icon-chat-square'
  603. // },
  604. // children: [{
  605. // path: 'history',
  606. // name: 'history',
  607. // component: () => import('@/views/notice/history'),
  608. // meta: {
  609. // title: '历史消息',
  610. // icon: 'el-icon-chat-dot-square'
  611. // }
  612. // },
  613. // {
  614. // path: 'push',
  615. // name: 'push',
  616. // component: () => import('@/views/notice/push'),
  617. // meta: {
  618. // title: '消息推送',
  619. // icon: 'el-icon-chat-line-square'
  620. // }
  621. // }
  622. // ]
  623. // },
  624. // // 会员中心
  625. // {
  626. // path: '/member',
  627. // component: Layout,
  628. // redirect: '/member/memberList',
  629. // name: 'member',
  630. // meta: {
  631. // title: '会员管理',
  632. // icon: 'el-icon-s-help'
  633. // },
  634. // children: [{
  635. // path: 'memberList',
  636. // name: 'memberList',
  637. // component: () => import('@/views/member/memberList/index'),
  638. // meta: {
  639. // title: '会员管理',
  640. // icon: 'table'
  641. // }
  642. // },
  643. // {
  644. // path: 'equity',
  645. // name: 'equity',
  646. // component: () => import('@/views/member/equity/index'),
  647. // meta: {
  648. // title: '会员权益',
  649. // icon: 'table'
  650. // }
  651. // },
  652. // {
  653. // hidden: true,
  654. // path: 'customerDetails',
  655. // name: 'customerDetails',
  656. // component: () => import('@/views/member/customerMage/customerDetails'),
  657. // meta: {
  658. // title: '会员详情',
  659. // icon: 'table'
  660. // }
  661. // },
  662. // {
  663. // path: 'tips',
  664. // name: 'tips',
  665. // component: () => import('@/views/member/tips/index'),
  666. // meta: {
  667. // title: '标签管理',
  668. // icon: 'tree'
  669. // }
  670. // },
  671. // {
  672. // path: 'levelList',
  673. // name: 'levelList',
  674. // component: () => import('@/views/member/levelList/index'),
  675. // meta: {
  676. // title: '会员等级',
  677. // icon: 'tree'
  678. // }
  679. // },
  680. // {
  681. // hidden: true,
  682. // path: 'addTips',
  683. // name: 'addTips',
  684. // component: () => import('@/views/member/tips/addTips'),
  685. // meta: {
  686. // title: '创建标签',
  687. // icon: 'tree'
  688. // }
  689. // }
  690. // ]
  691. // },
  692. // // 直播管理
  693. // {
  694. // path: '/liveMenu',
  695. // component: Layout,
  696. // redirect: '/member/memberList',
  697. // name: 'liveMenu',
  698. // meta: {
  699. // title: '直播管理',
  700. // icon: 'el-icon-s-help'
  701. // },
  702. // children: [
  703. // {
  704. // path: '/liveMenu/liveRoom',
  705. // name: 'liveRoom',
  706. // component: () => import('@/views/liveMenu/liveRoom/index.vue'),
  707. // meta: {
  708. // title: '直播间管理',
  709. // icon: 'table'
  710. // }
  711. // },
  712. // {
  713. // path: '/liveMenu/liveProduct',
  714. // name: 'liveProduct',
  715. // component: () => import('@/views/liveMenu/liveProduct/index.vue'),
  716. // meta: {
  717. // title: '直播商品管理',
  718. // icon: 'tree'
  719. // }
  720. // }
  721. // ]
  722. // }
  723. // // 404 page must be placed at the end !!!
  724. // // {
  725. // // path: '*',
  726. // // redirect: '/404',
  727. // // hidden: true
  728. // // }
  729. // ]
  730. export const mainRoutes = [
  731. {
  732. path: '/login',
  733. component: () => import('@/views/login/index'),
  734. hidden: true
  735. },
  736. {
  737. path: '/404',
  738. component: () => import('@/views/404'),
  739. hidden: true
  740. },
  741. {
  742. path: '/',
  743. component: Layout,
  744. redirect: '/dashboard',
  745. meta: {
  746. title: '总览',
  747. icon: 'el-icon-monitor'
  748. },
  749. children: [ {
  750. path: 'dashboard',
  751. name: 'dashboard',
  752. component: () => import('@/views/dashboard/index.vue'),
  753. meta: {
  754. title: '总览',
  755. icon: 'el-icon-monitor'
  756. }
  757. } ]
  758. }
  759. // {
  760. // path: '/marketingManagement',
  761. // component: Layout,
  762. // redirect: '/marketingManagement/voucher',
  763. // resourceType: 'catalog',
  764. // alwaysShow: true, // 这个代表为目录
  765. // meta: {
  766. // title: '营销管理',
  767. // icon: 'el-icon-monitor'
  768. // },
  769. // children: [ {
  770. // path: 'voucher',
  771. // name: 'voucher',
  772. // component: () => import('@/views/marketingManagement/voucher/index.vue'),
  773. // meta: {
  774. // title: '代金卷管理',
  775. // icon: 'el-icon-monitor'
  776. // }
  777. // } ]
  778. // }
  779. ]
  780. const createRouter = () => new Router({
  781. // mode: 'history', // require service support
  782. scrollBehavior: () => ({
  783. y: 0
  784. }),
  785. // routes: constantRoutes
  786. routes: mainRoutes
  787. })
  788. const router = createRouter()
  789. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  790. export function resetRouter() {
  791. const newRouter = createRouter()
  792. router.matcher = newRouter.matcher // reset router
  793. }
  794. export default router