router.config.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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. path: '/shop/order',
  58. redirect: '/shop/order/list',
  59. name: 'shopOrder',
  60. component: RouteView,
  61. meta: {
  62. title: '订单管理',
  63. icon: 'profile'
  64. // permission: 'M_tenants_list'
  65. },
  66. hideChildrenInMenu: true,
  67. children: [{
  68. path: '/shop/order/list',
  69. name: 'shopOrderList',
  70. component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/shopOrder.vue'),
  71. meta: {
  72. title: '订单列表',
  73. icon: 'profile',
  74. hidden: true
  75. // permission: 'M_tenants_list'
  76. }
  77. },
  78. {
  79. path: '/shop/order/detail/:id',
  80. name: 'shopOrderDetail',
  81. component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/orderDetail.vue'),
  82. meta: {
  83. title: '订单详情',
  84. icon: 'profile',
  85. hidden: true
  86. // permission: 'M_tenants_list'
  87. }
  88. }
  89. ]
  90. },
  91. {
  92. path: '/shop/goods',
  93. redirect: '/shop/goods/list',
  94. name: 'goodsList',
  95. component: RouteView,
  96. meta: {
  97. title: '商品管理',
  98. icon: 'shopping',
  99. permission: 'M_goodsManage_list'
  100. },
  101. hideChildrenInMenu: true,
  102. children: [{
  103. path: '/shop/goods/list',
  104. name: 'goodsListList',
  105. component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsList.vue'),
  106. meta: {
  107. title: '商品列表',
  108. icon: 'shopping',
  109. hidden: true,
  110. permission: 'M_goodsManage_list'
  111. }
  112. },
  113. {
  114. path: '/shop/goods/add',
  115. name: 'goodsListAdd',
  116. component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsEdit.vue'),
  117. meta: {
  118. title: '新增商品',
  119. icon: 'shopping',
  120. hidden: true,
  121. permission: 'B_goodsManage_add'
  122. }
  123. },
  124. {
  125. path: '/shop/goods/edit/:id',
  126. name: 'goodsListEdit',
  127. component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsEdit.vue'),
  128. meta: {
  129. title: '编辑商品',
  130. icon: 'shopping',
  131. hidden: true,
  132. permission: 'B_goodsManage_edit'
  133. }
  134. }
  135. ]
  136. },
  137. {
  138. path: '/shop/goodsShelves',
  139. name: 'goodsShelves',
  140. component: () => import(/* webpackChunkName: "tenants" */ '@/views/shop/goodsShelves.vue'),
  141. meta: {
  142. title: '商品排序',
  143. icon: 'flag'
  144. // permission: 'M_tenants_list'
  145. }
  146. },
  147. {
  148. path: '/shop/bannerSetting',
  149. name: 'bannerSetting',
  150. component: () => import(/* webpackChunkName: "appSetting" */ '@/views/shop/bannerSetting.vue'),
  151. meta: {
  152. title: '推广位设置',
  153. icon: 'file-image'
  154. // permission: 'M_banner'
  155. }
  156. }
  157. ]
  158. },
  159. {
  160. path: '/businessManage',
  161. redirect: '/businessManag/userManage',
  162. component: PageView,
  163. meta: {
  164. title: '商户管理',
  165. icon: 'appstore'
  166. // permission: 'M_appSetting'
  167. },
  168. children: [{
  169. path: '/businessManage/userManage',
  170. name: 'userManage',
  171. component: () => import(/* webpackChunkName: "tenants" */ '@/views/businessManage/userManage/userManage.vue'),
  172. meta: {
  173. title: '用户管理',
  174. icon: 'folder'
  175. // permission: 'M_tenants_list'
  176. }
  177. },
  178. {
  179. path: '/businessManage/partnerManage',
  180. name: 'partnerManage',
  181. component: () => import(/* webpackChunkName: "tenants" */ '@/views/businessManage/partnerManage/partnerManage.vue'),
  182. meta: {
  183. title: '合作商管理',
  184. icon: 'solution'
  185. // permission: 'M_tenants_list'
  186. }
  187. }
  188. ]
  189. },
  190. {
  191. path: '/equipmentManage',
  192. redirect: '/equipmentManage/network',
  193. component: PageView,
  194. meta: {
  195. title: '网点设备管理',
  196. icon: 'shop'
  197. // permission: 'M_tenants_list'
  198. },
  199. children: [{
  200. path: '/equipmentManage/network',
  201. name: 'network',
  202. component: () => import(/* webpackChunkName: "tenants" */ '@/views/equipmentManage/network/network.vue'),
  203. meta: {
  204. title: '网点管理',
  205. icon: 'profile'
  206. // permission: 'M_tenants_list'
  207. }
  208. },
  209. {
  210. path: '/equipmentManage/equipment',
  211. name: 'equipment',
  212. component: () => import(/* webpackChunkName: "tenants" */ '@/views/equipmentManage/equipment/equipment.vue'),
  213. meta: {
  214. title: '设备管理',
  215. icon: 'profile'
  216. // permission: 'M_tenants_list'
  217. }
  218. },
  219. {
  220. path: '/equipmentManage/boxSetting',
  221. name: 'boxSetting',
  222. component: () => import(/* webpackChunkName: "tenants" */ '@/views/equipmentManage/boxSetting/boxSetting.vue'),
  223. meta: {
  224. title: '箱体类型设置',
  225. icon: 'profile'
  226. // permission: 'M_tenants_list'
  227. }
  228. },
  229. {
  230. path: '/equipmentManage/exchangeSetting',
  231. name: 'exchangeSetting',
  232. component: () => import(/* webpackChunkName: "tenants" */ '@/views/equipmentManage/exchangeSetting/ExchangeSetting.vue'),
  233. meta: {
  234. title: '兑换规则设置',
  235. icon: 'profile'
  236. // permission: 'M_tenants_list'
  237. }
  238. },
  239. {
  240. path: '/equipmentManage/openTimeSetting',
  241. name: 'openTimeSetting',
  242. component: () => import(/* webpackChunkName: "tenants" */
  243. '@/views/equipmentManage/openTimeSetting/OpenTimeSetting.vue'),
  244. meta: {
  245. title: '投放时间设置',
  246. icon: 'profile'
  247. // permission: 'M_tenants_list'
  248. }
  249. }
  250. ]
  251. },
  252. {
  253. path: '/releaseRecord',
  254. name: 'releaseRecord',
  255. component: PageView,
  256. hideChildrenInMenu: true,
  257. redirect: '/releaseRecord/list',
  258. meta: {
  259. title: '投放记录',
  260. icon: 'shop'
  261. // permission: 'M_tenants_list'
  262. },
  263. children: [{
  264. path: '/releaseRecord/list',
  265. name: 'releaseRecordList',
  266. component: () => import(/* webpackChunkName: "tenants" */ '@/views/releaseRecord/releaseRecordList.vue'),
  267. meta: {
  268. title: '投放记录',
  269. icon: 'profile'
  270. // permission: 'M_tenants_list'
  271. }
  272. }]
  273. },
  274. {
  275. path: '/shopSetting',
  276. redirect: '/shopSetting/bannerSetting',
  277. component: PageView,
  278. meta: {
  279. title: '商城设置',
  280. icon: 'appstore',
  281. permission: 'M_goodsClass_list'
  282. },
  283. children: [{
  284. path: '/shopSetting/goodsClass',
  285. name: 'goodsClass',
  286. component: () => import(/* webpackChunkName: "tenants" */ '@/views/shopSetting/goodsClass.vue'),
  287. meta: {
  288. title: '商品分类管理',
  289. icon: 'folder',
  290. permission: 'M_goodsClass_list'
  291. }
  292. },
  293. {
  294. path: '/shopSetting/supplier',
  295. name: 'supplier',
  296. component: () => import(/* webpackChunkName: "tenants" */ '@/views/shopSetting/supplier.vue'),
  297. meta: {
  298. title: '供货商管理',
  299. icon: 'solution',
  300. permission: 'M_supplier_list'
  301. }
  302. }
  303. ]
  304. },
  305. // auth
  306. {
  307. path: '/auth',
  308. redirect: '/auth/userList',
  309. component: PageView,
  310. meta: {
  311. title: '权限管理',
  312. icon: 'lock'
  313. // permission: 'M_auth_0'
  314. },
  315. children: [{
  316. path: '/menusAuth/menu',
  317. name: 'powerMenu',
  318. component: () => import(/* webpackChunkName: "auth" */ '@/views/power/menu/menu.vue'),
  319. meta: {
  320. title: '菜单管理',
  321. icon: 'profile'
  322. // permission: 'M_menusAuth_menu'
  323. }
  324. },
  325. {
  326. path: '/auth/userList',
  327. name: 'powerUserList',
  328. component: () => import(/* webpackChunkName: "auth" */ '@/views/power/user/userList.vue'),
  329. meta: {
  330. title: '用户管理',
  331. icon: 'user'
  332. // permission: 'M_auth_userList'
  333. }
  334. },
  335. {
  336. path: '/auth/roleList',
  337. name: 'powerRoleList',
  338. component: () => import(/* webpackChunkName: "auth" */ '@/views/power/role/roleList.vue'),
  339. meta: {
  340. title: '角色管理',
  341. icon: 'solution'
  342. // permission: 'M_auth_roleList'
  343. }
  344. }
  345. ]
  346. },
  347. {
  348. path: '/setting',
  349. redirect: '/setting/userList',
  350. component: PageView,
  351. meta: {
  352. title: '系统设置',
  353. icon: 'setting'
  354. // permission: 'M_setting_0'
  355. },
  356. children: [{
  357. path: '/setting/dataDictionary',
  358. name: 'powerDD',
  359. component: () => import(/* webpackChunkName: "setting" */
  360. '@/views/power/dataDictionary/dataDictionary.vue'),
  361. meta: {
  362. title: '数据字典管理',
  363. icon: 'database'
  364. // permission: 'M_sys_dataDictionary'
  365. }
  366. },
  367. // {
  368. // path: '/setting/register',
  369. // name: 'powerRegister',
  370. // component: () => import(/* webpackChunkName: "setting" */ '@/views/power/register/register.vue'),
  371. // meta: {
  372. // title: '参数管理',
  373. // icon: 'key'
  374. // // permission: 'M_sys_register'
  375. // }
  376. // },
  377. // {
  378. // path: '/setting/jobs',
  379. // name: 'powerJobs',
  380. // component: () => import(/* webpackChunkName: "setting" */ '@/views/power/job/jobs.vue'),
  381. // meta: {
  382. // title: '定时器',
  383. // icon: 'alert',
  384. // permission: 'M_sys_job'
  385. // }
  386. // },
  387. {
  388. path: '/setting/OperateJournal',
  389. name: 'powerOperateJournal',
  390. component: () => import(/* webpackChunkName: "setting" */
  391. '@/views/power/OperateJournal/OperateJournal.vue'),
  392. meta: {
  393. title: '操作日志',
  394. icon: 'read'
  395. // permission: 'M_operateJournal'
  396. }
  397. }
  398. ]
  399. }
  400. ]
  401. },
  402. {
  403. path: '*',
  404. redirect: '/404',
  405. hidden: true
  406. }
  407. ]
  408. /**
  409. * 基础路由
  410. * @type { *[] }
  411. */
  412. export const constantRouterMap = [{
  413. path: '/user',
  414. component: UserLayout,
  415. redirect: '/user/login',
  416. hidden: true,
  417. children: [{
  418. path: 'login',
  419. name: 'login',
  420. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
  421. },
  422. {
  423. path: 'register',
  424. name: 'register',
  425. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
  426. },
  427. {
  428. path: 'register-result',
  429. name: 'registerResult',
  430. component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
  431. },
  432. {
  433. path: 'recover',
  434. name: 'recover',
  435. component: undefined
  436. }
  437. ]
  438. },
  439. {
  440. path: '/404',
  441. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  442. }
  443. ]