index.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  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: '控制台',
  30. breadcrumb: [
  31. {title: '首页', 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: '报单列表',
  47. breadcrumb: [
  48. {title: '首页', path: '/dashboard/index'},
  49. {title: '商城管理', 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: '订单列表',
  59. breadcrumb: [
  60. {title: '首页', path: '/dashboard/index'},
  61. {title: '商城管理', 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: '商品列表',
  71. breadcrumb: [
  72. {title: '首页', path: '/dashboard/index'},
  73. {title: '商城管理', path: '/shop/dec-order-list'},
  74. ],
  75. },
  76. },
  77. {
  78. path: '/shop/order',
  79. component: _import('shop/order'),
  80. name: 'shop_order',
  81. meta: {
  82. title: '商品结算',
  83. breadcrumb: [
  84. {title: '首页', path: '/dashboard/index'},
  85. {title: '商城管理', path: '/shop/dec-order-list'}
  86. ],
  87. },
  88. },
  89. {
  90. path: '/shop/goods-detail/:id',
  91. component: _import('shop/goods-detail'),
  92. name: 'shop_goods-detail',
  93. meta: {
  94. title: '商品详情',
  95. breadcrumb: [
  96. {title: '首页', path: '/dashboard/index'},
  97. {title: '商城管理', path: '/shop/dec-order-list'},
  98. ],
  99. },
  100. },
  101. {
  102. path: '/shop/reconsume',
  103. component: _import('shop/reconsume'),
  104. name: 'shop_reconsume',
  105. meta: {
  106. title: '复消商品',
  107. breadcrumb: [
  108. {title: '首页', path: '/dashboard/index'},
  109. {title: '商城管理', path: '/shop/dec-order-list'},
  110. ],
  111. },
  112. },
  113. {
  114. path: '/shop/reconsume-order',
  115. component: _import('shop/reconsume-order'),
  116. name: 'reconsume-order',
  117. meta: {
  118. title: '复消商品结算',
  119. breadcrumb: [
  120. {title: '首页', path: '/dashboard/index'},
  121. {title: '商城管理', path: '/shop/dec-order-list'}
  122. ],
  123. },
  124. },
  125. ],
  126. },
  127. {
  128. path: '/user',
  129. component: layout,
  130. redirect: '/user/index',
  131. children: [
  132. {
  133. path: '/user/index',
  134. component: _import('user/index'),
  135. name: 'user_index',
  136. meta: {
  137. title: '个人资料',
  138. breadcrumb: [
  139. {title: '首页', path: '/dashboard/index'},
  140. {title: '会员管理', path: '/user/index'},
  141. ],
  142. },
  143. },
  144. {
  145. path: '/user/password',
  146. component: _import('user/password'),
  147. name: 'user_password',
  148. meta: {
  149. title: '重置密码',
  150. breadcrumb: [
  151. {title: '首页', path: '/dashboard/index'},
  152. {title: '会员管理', path: '/user/index'},
  153. ],
  154. },
  155. },
  156. {
  157. path: '/user/id-card',
  158. component: _import('user/id-card'),
  159. name: 'user_id-card',
  160. meta: {
  161. title: '上传身份证',
  162. breadcrumb: [
  163. {title: '首页', path: '/dashboard/index'},
  164. {title: '会员管理', path: '/user/index'},
  165. ],
  166. },
  167. },
  168. {
  169. path: '/user/rec-user',
  170. component: _import('user/rec-user'),
  171. name: 'user_rec-user',
  172. meta: {
  173. title: '开拓会员列表',
  174. breadcrumb: [
  175. {title: '首页', path: '/dashboard/index'},
  176. {title: '会员管理', path: '/user/index'},
  177. ],
  178. },
  179. },
  180. {
  181. path: '/user/bind',
  182. component: _import('user/bind'),
  183. name: 'user_bind',
  184. meta: {
  185. title: '点位绑定列表',
  186. breadcrumb: [
  187. {title: '首页', path: '/dashboard/index'},
  188. {title: '会员管理', path: '/user/index'},
  189. ],
  190. },
  191. },
  192. {
  193. path: '/user/bind-edit/:id',
  194. component: _import('user/bind-edit'),
  195. name: 'user_bind-edit',
  196. meta: {
  197. title: '点位绑定编辑',
  198. highLight: '/user/bind',
  199. breadcrumb: [
  200. {title: '首页', path: '/dashboard/index'},
  201. {title: '会员管理', path: '/user/index'},
  202. {title: '点位绑定列表', path: '/user/bind'},
  203. ],
  204. },
  205. },
  206. {
  207. path: '/user/dec',
  208. component: _import('user/dec'),
  209. name: 'user_dec',
  210. meta: {
  211. title: '报单管理',
  212. breadcrumb: [
  213. {title: '首页', path: '/dashboard/index'},
  214. {title: '会员管理', path: '/user/index'},
  215. ],
  216. },
  217. },
  218. ]
  219. },
  220. {
  221. path: '/atlas',
  222. component: layout,
  223. redirect: '/atlas/network',
  224. children: [
  225. {
  226. path: '/atlas/network',
  227. component: _import('atlas/network'),
  228. name: 'atlas_network',
  229. meta: {
  230. title: '安置网络',
  231. breadcrumb: [
  232. {title: '首页', path: '/dashboard/index'},
  233. {title: '网络图谱', path: '/atlas/network'},
  234. ],
  235. },
  236. },
  237. ]
  238. },
  239. {
  240. path: '/bonus',
  241. component: layout,
  242. redirect: '/bonus/index',
  243. children: [
  244. {
  245. path: '/bonus/index',
  246. component: _import('bonus/index'),
  247. name: 'bonus_index',
  248. meta: {
  249. title: '我的账户',
  250. breadcrumb: [
  251. {title: '首页', path: '/dashboard/index'},
  252. {title: '奖金管理', path: '/bonus/index'},
  253. ],
  254. },
  255. },
  256. {
  257. path: '/bonus/new',
  258. component: _import('bonus/new'),
  259. name: 'bonus_new',
  260. meta: {
  261. title: '最新奖金',
  262. breadcrumb: [
  263. {title: '首页', path: '/dashboard/index'},
  264. {title: '奖金管理', path: '/bonus/index'},
  265. ],
  266. },
  267. },
  268. {
  269. path: '/bonus/other',
  270. component: _import('bonus/other'),
  271. name: 'bonus_other',
  272. meta: {
  273. title: '往期奖金',
  274. breadcrumb: [
  275. {title: '首页', path: '/dashboard/index'},
  276. {title: '奖金管理', path: '/bonus/index'},
  277. ],
  278. },
  279. },
  280. {
  281. path: '/bonus/real-time-perf',
  282. component: _import('bonus/real-time-perf'),
  283. name: 'bonus_real-time-perf',
  284. meta: {
  285. title: '实时业绩',
  286. breadcrumb: [
  287. {title: '首页', path: '/dashboard/index'},
  288. {title: '奖金管理', path: '/bonus/index'},
  289. ],
  290. },
  291. },
  292. {
  293. path: '/bonus/fc-point',
  294. component: _import('bonus/fc-point'),
  295. name: 'bonus_fc-point',
  296. meta: {
  297. title: '房产积分',
  298. breadcrumb: [
  299. {title: '首页', path: '/dashboard/index'},
  300. {title: '奖金管理', path: '/bonus/index'},
  301. ],
  302. },
  303. },
  304. {
  305. path: '/bonus/teams',
  306. component: _import('bonus/teams'),
  307. name: 'bonus_teams',
  308. meta: {
  309. title: '团队查询',
  310. breadcrumb: [
  311. {title: '首页', path: '/dashboard/index'},
  312. {title: '奖金管理', path: '/bonus/index'},
  313. ],
  314. },
  315. },
  316. ]
  317. },
  318. {
  319. path: '/article',
  320. component: layout,
  321. redirect: '/article/list',
  322. children: [
  323. {
  324. path: '/article/list/:cid',
  325. component: _import('article/list'),
  326. name: 'article_list',
  327. meta: {
  328. title: '文章列表',
  329. breadcrumb: [
  330. {title: '首页', path: '/dashboard/index'},
  331. {title: '文章管理', path: '/article/list'},
  332. ],
  333. },
  334. },
  335. {
  336. path: '/article/detail/:id',
  337. component: _import('article/detail'),
  338. name: 'article_detail',
  339. meta: {
  340. title: '文章详情',
  341. breadcrumb: [
  342. {title: '首页', path: '/dashboard/index'},
  343. {title: '文章管理', path: '/article/list'},
  344. ],
  345. },
  346. },
  347. ]
  348. },
  349. {
  350. path: '/message',
  351. component: layout,
  352. redirect: '/message/list',
  353. children: [
  354. {
  355. path: '/message/list',
  356. component: _import('message/list'),
  357. name: 'message_list',
  358. meta: {
  359. title: '站内信列表',
  360. breadcrumb: [
  361. {title: '首页', path: '/dashboard/index'},
  362. {title: '站内信', path: '/message/list'},
  363. ],
  364. },
  365. },
  366. {
  367. path: '/message/detail/:id',
  368. component: _import('message/detail'),
  369. name: 'message_detail',
  370. meta: {
  371. title: '站内信详情',
  372. breadcrumb: [
  373. {title: '首页', path: '/dashboard/index'},
  374. {title: '站内信', path: '/message/list'},
  375. ],
  376. },
  377. },
  378. ]
  379. },
  380. {
  381. path: '/finance',
  382. component: layout,
  383. redirect: '/finance/withdraw',
  384. children: [
  385. {
  386. path: '/finance/reconsume-pool-flow',
  387. component: _import('finance/reconsume-pool-flow'),
  388. name: 'finance_reconsume-pool-flow',
  389. meta: {
  390. title: '会员复销池余额流水',
  391. breadcrumb: [
  392. {title: '首页', path: '/dashboard/index'},
  393. {title: '财务管理', path: '/finance/withdraw'},
  394. ],
  395. },
  396. },
  397. {
  398. path: '/finance/withdraw',
  399. component: _import('finance/withdraw'),
  400. name: 'finance_withdraw',
  401. meta: {
  402. title: '提现明细',
  403. breadcrumb: [
  404. {title: '首页', path: '/dashboard/index'},
  405. {title: '财务管理', path: '/finance/index'},
  406. ],
  407. },
  408. },
  409. {
  410. path: '/finance/withdraw-add',
  411. component: _import('finance/withdraw-add'),
  412. name: 'finance_withdraw-add',
  413. meta: {
  414. title: '我要提现',
  415. highLight: '/finance/withdraw',
  416. breadcrumb: [
  417. {title: '首页', path: '/dashboard/index'},
  418. {title: '财务管理', path: '/finance/index'},
  419. {title: '提现明细', path: '/finance/withdraw'},
  420. ],
  421. },
  422. },
  423. {
  424. path: '/finance/dec-list',
  425. component: _import('finance/dec-list'),
  426. name: 'finance_dec-list',
  427. meta: {
  428. title: '报单订货单列表',
  429. breadcrumb: [
  430. {title: '首页', path: '/dashboard/index'},
  431. {title: '财务管理', path: '/finance/index'},
  432. ],
  433. },
  434. },
  435. {
  436. path: '/finance/transfer-list',
  437. component: _import('finance/transfer-list'),
  438. name: 'finance_transfer-list',
  439. meta: {
  440. title: '转账记录',
  441. breadcrumb: [
  442. {title: '首页', path: '/dashboard/index'},
  443. {title: '财务管理', path: '/finance/index'},
  444. ],
  445. },
  446. },
  447. {
  448. path: '/finance/transfer-add',
  449. component: _import('finance/transfer-add'),
  450. name: 'finance_transfer-add',
  451. meta: {
  452. title: '我要转账',
  453. highLight: '/finance/transfer-list',
  454. breadcrumb: [
  455. {title: '首页', path: '/dashboard/index'},
  456. {title: '财务管理', path: '/finance/index'},
  457. {title: '转账记录', path: '/finance/transfer-list'},
  458. ],
  459. },
  460. },
  461. {
  462. path: '/finance/recharge',
  463. component: _import('finance/recharge'),
  464. name: 'finance_recharge',
  465. meta: {
  466. title: '充值明细',
  467. breadcrumb: [
  468. {title: '首页', path: '/dashboard/index'},
  469. {title: '财务管理', path: '/finance/index'},
  470. ],
  471. },
  472. },
  473. {
  474. path: '/finance/recharge-add',
  475. component: _import('finance/recharge-add'),
  476. name: 'finance_recharge-add',
  477. meta: {
  478. title: '我要充值',
  479. highLight: '/finance/recharge',
  480. breadcrumb: [
  481. {title: '首页', path: '/dashboard/index'},
  482. {title: '财务管理', path: '/finance/index'},
  483. {title: '提现明细', path: '/finance/withdraw'},
  484. ],
  485. },
  486. },
  487. ]
  488. },
  489. {
  490. path: '/config',
  491. component: layout,
  492. redirect: '/config/base',
  493. children: [
  494. {
  495. path: '/config/receive-address-list',
  496. component: _import('config/receive-address-list'),
  497. name: 'config_receive-address-list',
  498. meta: {
  499. title: '收货地址管理',
  500. breadcrumb: [
  501. {title: '首页', path: '/dashboard/index'},
  502. {title: '设置', path: '/config/base'},
  503. ],
  504. },
  505. },
  506. {
  507. path: '/config/receive-address-add',
  508. component: _import('config/receive-address-edit'),
  509. name: 'config_receive-address-add',
  510. meta: {
  511. title: '添加收货地址',
  512. highLight: '/config/receive-address-list',
  513. breadcrumb: [
  514. {title: '首页', path: '/dashboard/index'},
  515. {title: '设置', path: '/config/base'},
  516. {title: '收货地址管理', path: '/config/receive-address-list'},
  517. ],
  518. },
  519. },
  520. {
  521. path: '/config/receive-address-edit/:id',
  522. component: _import('config/receive-address-edit'),
  523. name: 'config_receive-address-edit',
  524. meta: {
  525. title: '编辑收货地址',
  526. highLight: '/config/receive-address-list',
  527. breadcrumb: [
  528. {title: '首页', path: '/dashboard/index'},
  529. {title: '设置', path: '/config/base'},
  530. {title: '收货地址管理', path: '/config/receive-address-list'},
  531. ],
  532. },
  533. },
  534. ]
  535. },
  536. ]
  537. export default new Router({
  538. routes: constantRouterMap
  539. })