index.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. import layout from '../views/layout/layout'
  4. const _import = require('./_import_' + process.env.NODE_ENV)
  5. if(Router.version >= '3.1.0'){
  6. const originalPush = Router.prototype.push
  7. Router.prototype.push = function push(location) {
  8. return originalPush.call(this, location).catch(err => err)
  9. }
  10. }
  11. Vue.use(Router)
  12. export const constantRouterMap = [
  13. {path: '/', redirect: '/login'},
  14. {path: '/login', component: _import('login/index'), name: 'login'},
  15. {path: '/login-by-backend', component: _import('login/login-by-backend'), name: 'login-by-backend'},
  16. {path: '/modify-password/:username', component: _import('login/modify-password'), name: 'modify-password'},
  17. // { path: '/authredirect', component: _import('login/authredirect'), hidden: true },
  18. // { path: '/404', component: _import('errorPage/404'), hidden: true },
  19. // { path: '/401', component: _import('errorPage/401'), hidden: true },
  20. {
  21. path: '/dashboard/index',
  22. component: layout,
  23. redirect: '/dashboard/index',
  24. children: [{
  25. path: '/dashboard/index',
  26. component: _import('dashboard/index'),
  27. name: 'dashboard_index',
  28. meta: {
  29. title: 'Dashboard',//控制台
  30. breadcrumb: [
  31. {title: 'Dashboard', path: '/dashboard/index'},//首页
  32. ],
  33. },
  34. }]
  35. },
  36. {
  37. path: '/shop',
  38. component: layout,
  39. redirect: '/shop/dec-order-list',
  40. children: [
  41. {
  42. path: '/shop/dec-order-list',
  43. component: _import('shop/dec-order-list'),
  44. name: 'shop_dec-order-list',
  45. meta: {
  46. title: 'Welcome Pack Listing',//报单列表
  47. breadcrumb: [
  48. {title: 'Dashboard', path: '/dashboard/index'},//首页
  49. {title: 'Shopping Mall', path: '/shop/dec-order-list'},//商城管理
  50. ],
  51. },
  52. },
  53. {
  54. path: '/shop/order-list',
  55. component: _import('shop/order-list'),
  56. name: 'shop_order-list',
  57. meta: {
  58. title: 'Order List',//订单列表
  59. breadcrumb: [
  60. {title: 'Dashboard', path: '/dashboard/index'},//首页
  61. {title: 'Shopping Mall', path: '/shop/dec-order-list'},//商城管理
  62. ],
  63. },
  64. },
  65. {
  66. path: '/shop/index',
  67. component: _import('shop/index'),
  68. name: 'shop_index',
  69. meta: {
  70. title: 'Products list',//商品列表
  71. breadcrumb: [
  72. {title: 'Dashboard', path: '/dashboard/index'},//首页
  73. {title: 'Shopping Mall', path: '/shop/dec-order-list'},//商城管理
  74. ],
  75. },
  76. },
  77. {
  78. path: '/shop/order-backing-out',
  79. component: _import('shop/order-backing-out'),
  80. name: 'shop_order-list',
  81. meta: {
  82. title: '订单退货',//订单退货
  83. breadcrumb: [
  84. {title: 'Dashboard', path: '/dashboard/index'},//首页
  85. {title: 'Shopping Mall', path: '/shop/dec-order-list'},//商城管理
  86. ],
  87. }
  88. },
  89. {
  90. path: '/shop/order',
  91. component: _import('shop/order'),
  92. name: 'shop_order',
  93. meta: {
  94. title: 'Products settlement',
  95. breadcrumb: [
  96. {title: 'Dashboard', path: '/dashboard/index'},//首页
  97. {title: 'Shopping Mall', path: '/shop/dec-order-list'}//商城管理
  98. ],
  99. },
  100. },
  101. {
  102. path: '/shop/goods-detail/:id',
  103. component: _import('shop/goods-detail'),
  104. name: 'shop_goods-detail',
  105. meta: {
  106. title: '商品详情',
  107. breadcrumb: [
  108. {title: 'Dashboard', path: '/dashboard/index'},
  109. {title: 'Shopping Mall', path: '/shop/dec-order-list'},
  110. ],
  111. },
  112. },
  113. // {
  114. // path: '/shop/reconsume',
  115. // component: _import('shop/reconsume'),
  116. // name: 'shop_reconsume',
  117. // meta: {
  118. // title: '复消商品',
  119. // breadcrumb: [
  120. // {title: '首页', path: '/dashboard/index'},
  121. // {title: '商城管理', path: '/shop/dec-order-list'},
  122. // ],
  123. // },
  124. // },
  125. // {
  126. // path: '/shop/reconsume-order',
  127. // component: _import('shop/reconsume-order'),
  128. // name: 'reconsume-order',
  129. // meta: {
  130. // title: '复消商品结算',
  131. // breadcrumb: [
  132. // {title: '首页', path: '/dashboard/index'},
  133. // {title: '商城管理', path: '/shop/dec-order-list'}
  134. // ],
  135. // },
  136. // },
  137. ],
  138. },
  139. {
  140. path: '/user',
  141. component: layout,
  142. redirect: '/user/index',
  143. children: [
  144. {
  145. path: '/user/index',
  146. component: _import('user/index'),
  147. name: 'user_index',
  148. meta: {
  149. title: 'Personal info',//个人资料
  150. breadcrumb: [
  151. {title: 'Dashboard', path: '/dashboard/index'},//首页
  152. {title: 'Member management', path: '/user/index'},//会员管理
  153. ],
  154. },
  155. },
  156. {
  157. path: '/user/password',
  158. component: _import('user/password'),
  159. name: 'user_password',
  160. meta: {
  161. title: 'Reset Password',//重置密码
  162. breadcrumb: [
  163. {title: 'Dashboard', path: '/dashboard/index'},//首页
  164. {title: 'Member management', path: '/user/index'},//会员管理
  165. ],
  166. },
  167. },
  168. {
  169. path: '/user/id-card',
  170. component: _import('user/id-card'),
  171. name: 'user_id-card',
  172. meta: {
  173. title: '上传身份证',
  174. breadcrumb: [
  175. {title: 'Dashboard', path: '/dashboard/index'},
  176. {title: 'Member management', path: '/user/index'},
  177. ],
  178. },
  179. },
  180. {
  181. path: '/user/rec-user',
  182. component: _import('user/rec-user'),
  183. name: 'user_rec-user',
  184. meta: {
  185. title: '开拓会员列表',
  186. breadcrumb: [
  187. {title: 'Dashboard', path: '/dashboard/index'},
  188. {title: 'Member management', path: '/user/index'},
  189. ],
  190. },
  191. },
  192. {
  193. path: '/user/bind',
  194. component: _import('user/bind'),
  195. name: 'user_bind',
  196. meta: {
  197. title: '点位绑定列表',
  198. breadcrumb: [
  199. {title: 'Dashboard', path: '/dashboard/index'},
  200. {title: 'Member management', path: '/user/index'},
  201. ],
  202. },
  203. },
  204. {
  205. path: '/user/bind-edit/:id',
  206. component: _import('user/bind-edit'),
  207. name: 'user_bind-edit',
  208. meta: {
  209. title: '点位绑定编辑',
  210. highLight: '/user/bind',
  211. breadcrumb: [
  212. {title: 'Dashboard', path: '/dashboard/index'},
  213. {title: 'Member management', path: '/user/index'},
  214. {title: '点位绑定列表', path: '/user/bind'},
  215. ],
  216. },
  217. },
  218. {
  219. path: '/user/dec',
  220. component: _import('user/dec'),
  221. name: 'user_dec',
  222. meta: {
  223. title: 'Welcome Pack management',//报单管理
  224. breadcrumb: [
  225. {title: 'Dashboard', path: '/dashboard/index'},//首页
  226. {title: 'Member management', path: '/user/index'},//会员管理
  227. ],
  228. },
  229. },
  230. {
  231. path: '/user/upgrade',
  232. component: _import('user/upgrade'),
  233. name: 'user_upgrade',
  234. meta: {
  235. title: 'Upgrade management',//升级管理
  236. highLight: '/user/bind',
  237. breadcrumb: [
  238. {title: 'Dashboard', path: '/dashboard/index'},//首页
  239. {title: 'Member management', path: '/user/index'},//会员管理
  240. ],
  241. },
  242. },
  243. ]
  244. },
  245. {
  246. path: '/atlas',
  247. component: layout,
  248. redirect: '/atlas/network',
  249. children: [
  250. {
  251. path: '/atlas/network',
  252. component: _import('atlas/network'),
  253. name: 'atlas_network',
  254. meta: {
  255. title: '安置网络',
  256. breadcrumb: [
  257. {title: 'Dashboard', path: '/dashboard/index'},
  258. {title: '网络图谱', path: '/atlas/network'},
  259. ],
  260. },
  261. },
  262. ]
  263. },
  264. {
  265. path: '/bonus',
  266. component: layout,
  267. redirect: '/bonus/index',
  268. children: [
  269. {
  270. path: '/bonus/index',
  271. component: _import('bonus/index'),
  272. name: 'bonus_index',
  273. meta: {
  274. title: 'My account',//我的账户
  275. breadcrumb: [
  276. {title: 'Dashboard', path: '/dashboard/index'},//首页
  277. {title: 'Bonus management', path: '/bonus/index'},//奖金管理
  278. ],
  279. },
  280. },
  281. {
  282. path: '/bonus/new',
  283. component: _import('bonus/new'),
  284. name: 'bonus_new',
  285. meta: {
  286. title: '最新奖金',
  287. breadcrumb: [
  288. {title: 'Dashboard', path: '/dashboard/index'},
  289. {title: 'Bonus management', path: '/bonus/index'},
  290. ],
  291. },
  292. },
  293. {
  294. path: '/bonus/other',
  295. component: _import('bonus/other'),
  296. name: 'bonus_other',
  297. meta: {
  298. title: 'Previous bonus',//往期奖金
  299. breadcrumb: [
  300. {title: 'Dashboard', path: '/dashboard/index'},//Dashboard
  301. {title: 'Bonus management', path: '/bonus/index'},//奖金管理
  302. ],
  303. },
  304. },
  305. {
  306. path: '/bonus/real-time-perf',
  307. component: _import('bonus/real-time-perf'),
  308. name: 'bonus_real-time-perf',
  309. meta: {
  310. title: '实时业绩',
  311. breadcrumb: [
  312. {title: 'Dashboard', path: '/dashboard/index'},
  313. {title: 'Bonus management', path: '/bonus/index'},
  314. ],
  315. },
  316. },
  317. {
  318. path: '/bonus/fc-point',
  319. component: _import('bonus/fc-point'),
  320. name: 'bonus_fc-point',
  321. meta: {
  322. title: '房产积分',
  323. breadcrumb: [
  324. {title: 'Dashboard', path: '/dashboard/index'},
  325. {title: 'Bonus management', path: '/bonus/index'},
  326. ],
  327. },
  328. },
  329. ]
  330. },
  331. {
  332. path: '/article',
  333. component: layout,
  334. redirect: '/article/list',
  335. children: [
  336. {
  337. path: '/article/list/:cid',
  338. component: _import('article/list'),
  339. name: 'article_list',
  340. meta: {
  341. title: 'Article List',
  342. breadcrumb: [
  343. {title: 'Dashboard', path: '/dashboard/index'},
  344. {title: 'Article Management', path: '/article/list'},
  345. ],
  346. },
  347. },
  348. {
  349. path: '/article/detail/:id',
  350. component: _import('article/detail'),
  351. name: 'article_detail',
  352. meta: {
  353. title: 'Article Detail',
  354. breadcrumb: [
  355. {title: 'Dashboard', path: '/dashboard/index'},
  356. {title: 'Article Management', path: '/article/list'},
  357. ],
  358. },
  359. },
  360. ]
  361. },
  362. {
  363. path: '/message',
  364. component: layout,
  365. redirect: '/message/list',
  366. children: [
  367. {
  368. path: '/message/list',
  369. component: _import('message/list'),
  370. name: 'message_list',
  371. meta: {
  372. title: '站内信列表',
  373. breadcrumb: [
  374. {title: 'Dashboard', path: '/dashboard/index'},
  375. {title: '站内信', path: '/message/list'},
  376. ],
  377. },
  378. },
  379. {
  380. path: '/message/detail/:id',
  381. component: _import('message/detail'),
  382. name: 'message_detail',
  383. meta: {
  384. title: '站内信详情',
  385. breadcrumb: [
  386. {title: 'Dashboard', path: '/dashboard/index'},
  387. {title: '站内信', path: '/message/list'},
  388. ],
  389. },
  390. },
  391. ]
  392. },
  393. {
  394. path: '/finance',
  395. component: layout,
  396. redirect: '/finance/withdraw',
  397. children: [
  398. {
  399. path: '/finance/reconsume-pool-flow',
  400. component: _import('finance/reconsume-pool-flow'),
  401. name: 'finance_reconsume-pool-flow',
  402. meta: {
  403. title: '会员复销池余额流水',
  404. breadcrumb: [
  405. {title: 'Dashboard', path: '/dashboard/index'},
  406. {title: 'Financial management', path: '/finance/withdraw'},
  407. ],
  408. },
  409. },
  410. {
  411. path: '/finance/withdraw',
  412. component: _import('finance/withdraw'),
  413. name: 'finance_withdraw',
  414. meta: {
  415. title: 'Withdrawal details',//提现明细
  416. breadcrumb: [
  417. {title: 'Dashboard', path: '/dashboard/index'},//首页
  418. {title: 'Financial management', path: '/finance/index'},//财务管理
  419. ],
  420. },
  421. },
  422. {
  423. path: '/finance/withdraw-add',
  424. component: _import('finance/withdraw-add'),
  425. name: 'finance_withdraw-add',
  426. meta: {
  427. title: 'Withdraw',//我要提现
  428. highLight: '/finance/withdraw',
  429. breadcrumb: [
  430. {title: 'Dashboard', path: '/dashboard/index'},//首页
  431. {title: 'Financial management', path: '/finance/index'},//财务管理
  432. {title: 'Withdrawal details', path: '/finance/withdraw'},//提现明细
  433. ],
  434. },
  435. },
  436. {
  437. path: '/finance/dec-list',
  438. component: _import('finance/dec-list'),
  439. name: 'finance_dec-list',
  440. meta: {
  441. title: '报单订货单列表',
  442. breadcrumb: [
  443. {title: 'Dashboard', path: '/dashboard/index'},
  444. {title: 'Financial management', path: '/finance/index'},
  445. ],
  446. },
  447. },
  448. {
  449. path: '/finance/transfer-list',
  450. component: _import('finance/transfer-list'),
  451. name: 'finance_transfer-list',
  452. meta: {
  453. title: '转账记录',
  454. breadcrumb: [
  455. {title: 'Dashboard', path: '/dashboard/index'},
  456. {title: 'Financial management', path: '/finance/index'},
  457. ],
  458. },
  459. },
  460. {
  461. path: '/finance/transfer-add',
  462. component: _import('finance/transfer-add'),
  463. name: 'finance_transfer-add',
  464. meta: {
  465. title: '我要转账',
  466. highLight: '/finance/transfer-list',
  467. breadcrumb: [
  468. {title: 'Dashboard', path: '/dashboard/index'},
  469. {title: 'Financial management', path: '/finance/index'},
  470. {title: '转账记录', path: '/finance/transfer-list'},
  471. ],
  472. },
  473. },
  474. {
  475. path: '/finance/recharge',
  476. component: _import('finance/recharge'),
  477. name: 'finance_recharge',
  478. meta: {
  479. title: 'Recharge details',//充值明细
  480. breadcrumb: [
  481. {title: 'Dashboard', path: '/dashboard/index'},//首页
  482. {title: 'financial management', path: '/finance/index'},//财务管理
  483. ],
  484. },
  485. },
  486. {
  487. path: '/finance/recharge-add',
  488. component: _import('finance/recharge-add'),
  489. name: 'finance_recharge-add',
  490. meta: {
  491. title: 'Recharge',//我要充值
  492. highLight: '/finance/recharge',
  493. breadcrumb: [
  494. {title: 'Dashboard', path: '/dashboard/index'},//首页
  495. {title: 'financial management', path: '/finance/index'},//财务管理
  496. {title: 'Withdrawal details', path: '/finance/withdraw'},
  497. ],
  498. },
  499. },
  500. ]
  501. },
  502. {
  503. path: '/config',
  504. component: layout,
  505. redirect: '/config/base',
  506. children: [
  507. {
  508. path: '/config/receive-address-list',
  509. component: _import('config/receive-address-list'),
  510. name: 'config_receive-address-list',
  511. meta: {
  512. title: 'Shipping Address',//收货地址管理
  513. breadcrumb: [
  514. {title: 'Dashboard', path: '/dashboard/index'},//首页
  515. {title: 'Setting', path: '/config/base'},//设置
  516. ],
  517. },
  518. },
  519. {
  520. path: '/config/receive-address-add',
  521. component: _import('config/receive-address-edit'),
  522. name: 'config_receive-address-add',
  523. meta: {
  524. title: 'Add shipping address',//添加收货地址
  525. highLight: '/config/receive-address-list',
  526. breadcrumb: [
  527. {title: 'Dashboard', path: '/dashboard/index'},//首页
  528. {title: 'Setting', path: '/config/base'},//设置
  529. {title: 'Shipping Address', path: '/config/receive-address-list'},//收货地址管理
  530. ],
  531. },
  532. },
  533. {
  534. path: '/config/receive-address-edit/:id',
  535. component: _import('config/receive-address-edit'),
  536. name: 'config_receive-address-edit',
  537. meta: {
  538. title: 'Edit address',
  539. highLight: '/config/receive-address-list',
  540. breadcrumb: [
  541. {title: 'Dashboard', path: '/dashboard/index'},//首页
  542. {title: 'Setting', path: '/config/base'},//设置
  543. {title: 'Shipping Address', path: '/config/receive-address-list'},//收货地址管理
  544. ],
  545. },
  546. },
  547. ]
  548. },
  549. ]
  550. export default new Router({
  551. routes: constantRouterMap
  552. })