router.config.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. // eslint-disable-next-line
  2. import {
  3. UserLayout,
  4. BasicLayout,
  5. RouteView,
  6. PageView
  7. } from '@/layouts'
  8. export const asyncRouterMap = [{
  9. path: '/',
  10. name: 'index',
  11. component: BasicLayout,
  12. meta: {
  13. title: '运营后台'
  14. },
  15. redirect: '/home',
  16. children: [{
  17. path: '/home',
  18. name: 'home',
  19. redirect: '/home',
  20. component: PageView,
  21. meta: {
  22. title: '首页',
  23. icon: 'home'
  24. },
  25. hideChildrenInMenu: true,
  26. children: [{
  27. path: '/home',
  28. name: 'home',
  29. component: () => import(/* webpackChunkName: "home" */ '@/views/Home'),
  30. meta: {
  31. title: '首页',
  32. icon: 'home',
  33. hiddenHeaderContent: true
  34. }
  35. }]
  36. },
  37. {
  38. path: '/changePwd',
  39. name: 'changePwd',
  40. hidden: true,
  41. component: () => import(/* webpackChunkName: "changePwd" */ '@/views/user/ChangePwd'),
  42. meta: {
  43. title: '修改密码',
  44. icon: 'home'
  45. }
  46. },
  47. {
  48. path: '/shop',
  49. redirect: '/shop/order',
  50. component: PageView,
  51. meta: {
  52. title: '商品',
  53. icon: 'shop',
  54. permission: 'M_shop'
  55. },
  56. children: [
  57. {
  58. path: '/shop/goods',
  59. redirect: '/shop/goods/list',
  60. name: 'goodsList',
  61. component: RouteView,
  62. meta: {
  63. title: '商品管理',
  64. icon: 'shopping',
  65. permission: 'M_goodsManage_list'
  66. },
  67. hideChildrenInMenu: true,
  68. children: [{
  69. path: '/shop/goods/list',
  70. name: 'goodsListList',
  71. component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/goodsList.vue'),
  72. meta: {
  73. title: '商品列表',
  74. icon: 'shopping',
  75. hidden: true,
  76. permission: 'M_goodsManage_list'
  77. }
  78. },
  79. {
  80. path: '/shop/goods/add',
  81. name: 'goodsListAdd',
  82. component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/goodsEdit.vue'),
  83. meta: {
  84. title: '新增商品',
  85. icon: 'shopping',
  86. hidden: true,
  87. permission: 'B_goodsManage_add'
  88. }
  89. },
  90. {
  91. path: '/shop/goods/edit/:id',
  92. name: 'goodsListEdit',
  93. component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/goodsEdit.vue'),
  94. meta: {
  95. title: '编辑商品',
  96. icon: 'shopping',
  97. hidden: true,
  98. permission: 'B_goodsManage_edit'
  99. }
  100. }
  101. ]
  102. },
  103. {
  104. path: '/shop/goodsShelves',
  105. name: 'goodsShelves',
  106. component: () => import(/* webpackChunkName: "shop" */ '@/views/shop/goodsShelves.vue'),
  107. meta: {
  108. title: '商品排序',
  109. icon: 'flag',
  110. permission: 'M_goodsShelves_0'
  111. }
  112. },
  113. {
  114. path: '/shopSetting/goodsClass',
  115. name: 'goodsClass',
  116. component: () => import(/* webpackChunkName: "shop" */ '@/views/shopSetting/goodsClass.vue'),
  117. meta: {
  118. title: '商品分类管理',
  119. icon: 'folder',
  120. permission: 'M_goodsClass_list'
  121. }
  122. }
  123. ]
  124. },
  125. {
  126. path: '/order',
  127. redirect: '/order/list',
  128. name: 'shopOrder',
  129. component: PageView,
  130. meta: {
  131. title: '订单',
  132. icon: 'profile'
  133. // permission: 'M_tenants_list'
  134. },
  135. hideChildrenInMenu: true,
  136. children: [
  137. {
  138. path: '/order/list',
  139. name: 'shopOrderList',
  140. component: () => import(/* webpackChunkName: "order" */ '@/views/shop/shopOrder.vue'),
  141. meta: {
  142. title: '订单管理',
  143. icon: 'profile'
  144. // permission: 'M_tenants_list'
  145. }
  146. },
  147. {
  148. path: '/order/detail/:id',
  149. name: 'shopOrderDetail',
  150. component: () => import(/* webpackChunkName: "order" */ '@/views/shop/orderDetail.vue'),
  151. meta: {
  152. title: '订单详情',
  153. icon: 'profile',
  154. hidden: true
  155. // permission: 'M_tenants_list'
  156. }
  157. }
  158. ]
  159. },
  160. // 用户
  161. {
  162. path: '/userInfo',
  163. redirect: '/userInfo/userManageList',
  164. component: PageView,
  165. meta: {
  166. title: '用户',
  167. icon: 'shop'
  168. // permission: 'M_shop'
  169. },
  170. children: [
  171. {
  172. path: '/userInfo/userManage',
  173. redirect: '/userInfo/userManageList/list',
  174. name: 'userManageList',
  175. component: RouteView,
  176. meta: {
  177. title: '用户管理',
  178. icon: 'profile'
  179. // permission: 'M_tenants_list'
  180. },
  181. hideChildrenInMenu: true,
  182. children: [{
  183. path: '/userInfo/userManageList/list',
  184. name: 'userManageList',
  185. component: () => import(/* webpackChunkName: "userInfo" */ '@/views/userInfo/userManageList.vue'),
  186. meta: {
  187. title: '用户列表',
  188. icon: 'profile',
  189. hidden: true
  190. // permission: 'M_tenants_list'
  191. }
  192. },
  193. {
  194. path: '/userInfo/userManageList_user/detail/:id',
  195. name: 'userManageDetail',
  196. component: () => import(/* webpackChunkName: "userInfo" */ '@/views/userInfo/userDetails.vue'),
  197. meta: {
  198. title: '用户详情',
  199. icon: 'profile',
  200. hidden: true
  201. // permission: 'M_tenants_list'
  202. }
  203. },
  204. {
  205. path: '/userInfo/userManageList_Ld/detail/:id',
  206. name: 'ledouDetail',
  207. component: () => import(/* webpackChunkName: "userInfo" */ '@/views/userInfo/LdDetails.vue'),
  208. meta: {
  209. title: '乐豆详情',
  210. icon: 'profile',
  211. hidden: true
  212. // permission: 'M_tenants_list'
  213. }
  214. }
  215. ]
  216. },
  217. {
  218. path: '/userInfo/releaseRecord/list',
  219. name: 'releaseRecordList',
  220. component: () => import(/* webpackChunkName: "userInfo" */ '@/views/releaseRecord/releaseRecordList.vue'),
  221. meta: {
  222. title: '投放记录',
  223. icon: 'profile'
  224. // permission: 'M_tenants_list'
  225. }
  226. }]
  227. },
  228. {
  229. path: '/shopSetting',
  230. redirect: '/shopSetting/bannerSetting',
  231. component: PageView,
  232. meta: {
  233. title: '商城设置',
  234. icon: 'appstore',
  235. permission: 'M_shopSetting'
  236. },
  237. children: [
  238. {
  239. path: '/shopSetting/bannerSetting',
  240. name: 'bannerSetting',
  241. component: () => import(/* webpackChunkName: "shopSetting" */ '@/views/shop/bannerSetting.vue'),
  242. meta: {
  243. title: '推广位设置',
  244. icon: 'file-image'
  245. // permission: 'M_AdBanner_list'
  246. }
  247. }
  248. ]
  249. },
  250. {
  251. path: '/equipmentManage',
  252. redirect: '/equipmentManage/network',
  253. component: PageView,
  254. meta: {
  255. title: '网点/设备',
  256. icon: 'shop'
  257. // permission: 'M_tenants_list'
  258. },
  259. children: [{
  260. path: '/equipmentManage/network',
  261. name: 'network',
  262. component: () => import(/* webpackChunkName: "equipmentManage" */ '@/views/equipmentManage/network/network.vue'),
  263. meta: {
  264. title: '网点管理',
  265. icon: 'profile'
  266. // permission: 'M_tenants_list'
  267. }
  268. },
  269. {
  270. path: '/equipmentManage/equipment',
  271. name: 'equipment',
  272. component: () => import(/* webpackChunkName: "equipmentManage" */ '@/views/equipmentManage/equipment/equipment.vue'),
  273. meta: {
  274. title: '设备管理',
  275. icon: 'profile'
  276. // permission: 'M_tenants_list'
  277. }
  278. },
  279. {
  280. path: '/equipmentManage/boxSetting',
  281. name: 'boxSetting',
  282. component: () => import(/* webpackChunkName: "equipmentManage" */ '@/views/equipmentManage/boxSetting/boxSetting.vue'),
  283. meta: {
  284. title: '箱体类型设置',
  285. icon: 'profile'
  286. // permission: 'M_tenants_list'
  287. }
  288. },
  289. {
  290. path: '/equipmentManage/exchangeSetting',
  291. name: 'exchangeSetting',
  292. component: () => import(/* webpackChunkName: "equipmentManage" */
  293. '@/views/equipmentManage/exchangeSetting/ExchangeSetting.vue'),
  294. meta: {
  295. title: '兑换规则设置',
  296. icon: 'profile'
  297. // permission: 'M_tenants_list'
  298. }
  299. },
  300. {
  301. path: '/equipmentManage/openTimeSetting',
  302. name: 'openTimeSetting',
  303. component: () => import(/* webpackChunkName: "equipmentManage" */ '@/views/equipmentManage/openTimeSetting/OpenTimeSetting.vue'),
  304. meta: {
  305. title: '投放时间设置',
  306. icon: 'profile'
  307. // permission: 'M_tenants_list'
  308. }
  309. }
  310. ]
  311. },
  312. {
  313. path: '/businessManage',
  314. redirect: '/businessManag/userManage',
  315. component: PageView,
  316. meta: {
  317. title: '乐享亭',
  318. icon: 'appstore',
  319. permission: 'M_partnerManage'
  320. },
  321. children: [
  322. {
  323. path: '/businessManage/partnerManage',
  324. name: 'partnerManage',
  325. component: () => import(/* webpackChunkName: "businessManage" */ '@/views/businessManage/partnerManage/partnerManage.vue'),
  326. meta: {
  327. title: '商户管理',
  328. icon: 'solution',
  329. permission: 'M_partnerManage_list'
  330. }
  331. },
  332. {
  333. path: '/businessManage/userManage',
  334. name: 'userManage',
  335. component: () => import(/* webpackChunkName: "businessManage" */ '@/views/businessManage/userManage/userManage.vue'),
  336. meta: {
  337. title: '用户管理',
  338. icon: 'folder'
  339. // permission: 'M_tenants_list'
  340. }
  341. }
  342. ]
  343. },
  344. {
  345. path: '/supplier',
  346. redirect: '/supplier/list',
  347. component: PageView,
  348. meta: {
  349. title: '供货商',
  350. icon: 'appstore',
  351. permission: 'M_shopSetting'
  352. },
  353. children: [
  354. {
  355. path: '/supplier/list',
  356. name: 'supplier',
  357. component: () => import(/* webpackChunkName: "supplier" */ '@/views/shopSetting/supplier.vue'),
  358. meta: {
  359. title: '供货商管理',
  360. icon: 'solution',
  361. permission: 'M_supplier_list'
  362. }
  363. }
  364. ]
  365. },
  366. // auth
  367. {
  368. path: '/auth',
  369. redirect: '/auth/userList',
  370. component: PageView,
  371. meta: {
  372. title: '权限管理',
  373. icon: 'lock'
  374. // permission: 'M_auth_0'
  375. },
  376. children: [
  377. {
  378. path: '/auth/userList',
  379. name: 'powerUserList',
  380. component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
  381. meta: {
  382. title: '用户管理',
  383. icon: 'user'
  384. // permission: 'M_auth_userList'
  385. }
  386. },
  387. {
  388. path: '/auth/roleList',
  389. name: 'powerRoleList',
  390. component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
  391. meta: {
  392. title: '角色管理',
  393. icon: 'solution'
  394. // permission: 'M_auth_roleList'
  395. }
  396. },
  397. {
  398. path: '/menusAuth/menu',
  399. name: 'powerMenu',
  400. component: () => import(/* webpackChunkName: "auth" */ '@/views/power/menu/menu.vue'),
  401. meta: {
  402. title: '菜单管理',
  403. icon: 'profile'
  404. // permission: 'M_menusAuth_menu'
  405. }
  406. }
  407. ]
  408. },
  409. {
  410. path: '/setting',
  411. redirect: '/setting/userList',
  412. component: PageView,
  413. meta: {
  414. title: '系统设置',
  415. icon: 'setting'
  416. // permission: 'M_setting_0'
  417. },
  418. children: [{
  419. path: '/setting/dataDictionary',
  420. name: 'powerDD',
  421. component: () => import(/* webpackChunkName: "setting" */
  422. '@/views/power/dataDictionary/dataDictionary.vue'),
  423. meta: {
  424. title: '数据字典管理',
  425. icon: 'database'
  426. // permission: 'M_sys_dataDictionary'
  427. }
  428. },
  429. {
  430. path: '/setting/OperateJournal',
  431. name: 'powerOperateJournal',
  432. component: () => import(/* webpackChunkName: "setting" */
  433. '@/views/power/OperateJournal/OperateJournal.vue'),
  434. meta: {
  435. title: '操作日志',
  436. icon: 'read'
  437. // permission: 'M_operateJournal'
  438. }
  439. }
  440. ]
  441. }
  442. ]
  443. },
  444. {
  445. path: '*',
  446. redirect: '/404',
  447. hidden: true
  448. }
  449. ]
  450. /**
  451. * 基础路由
  452. * @type { *[] }
  453. */
  454. export const constantRouterMap = [{
  455. path: '/user',
  456. component: UserLayout,
  457. redirect: '/user/login',
  458. hidden: true,
  459. children: [{
  460. path: 'login',
  461. name: 'login',
  462. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
  463. },
  464. {
  465. path: 'register',
  466. name: 'register',
  467. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
  468. },
  469. {
  470. path: 'register-result',
  471. name: 'registerResult',
  472. component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
  473. },
  474. {
  475. path: 'recover',
  476. name: 'recover',
  477. component: undefined
  478. }
  479. ]
  480. },
  481. {
  482. path: '/404',
  483. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  484. }
  485. ]