api.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const baseUrl = '/api'
  2. const $api = {
  3. login: { // 登陆
  4. signin: {
  5. method: 'post',
  6. url: `${baseUrl}/guest/signin`
  7. }
  8. },
  9. system: {
  10. init: { // 初始化菜单
  11. method: 'get',
  12. url: `${baseUrl}/common/system/init`
  13. },
  14. getGoodsSpecList: { // 商品规格列表
  15. method: 'get',
  16. url: `${baseUrl}/common/spec/goods`
  17. },
  18. addGoodsSpec: { // 新增商品规格
  19. method: 'POST',
  20. url: `${baseUrl}/common/spec/goods`
  21. },
  22. editGoodsSpec: { // 编辑商品规格
  23. method: 'put',
  24. url: `${baseUrl}/common/spec/goods`
  25. }
  26. },
  27. cms: {
  28. location: { // 图片位置
  29. method: 'get',
  30. url: `${baseUrl}/common/cms/location`
  31. },
  32. imageList: { // 轮播图列表
  33. method: 'get',
  34. url: `${baseUrl}/common/cms/image`
  35. },
  36. addImage: { // 添加轮播图
  37. method: 'get',
  38. url: `${baseUrl}/common/cms/image`
  39. }
  40. },
  41. file: {
  42. image: { // 图片上传
  43. method: 'post',
  44. url: `${baseUrl}/common/file`
  45. }
  46. }
  47. }
  48. export default $api