index.js 706 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const { request } = require('../../../api/request')
  2. /**
  3. * 商品添加
  4. * @param obj
  5. * @returns {Promise<*>}
  6. */
  7. export const postAddProduct = (obj) => request({
  8. url: '/api/shop/product/add',
  9. method: 'POST',
  10. data: {
  11. ...obj
  12. },
  13. showLoading: true
  14. })
  15. /**
  16. * 商品编辑
  17. * @param obj
  18. * @returns {Promise<*>}
  19. */
  20. export const postModifyProduct = (obj) => request({
  21. url: '/api/shop/product/modify',
  22. method: 'POST',
  23. data: {
  24. ...obj
  25. },
  26. showLoading: true
  27. })
  28. /**
  29. * 商品详情
  30. * @param id 商品ID
  31. * @returns {Promise<*>}
  32. */
  33. export const getProductDetail = (id) => request({
  34. url: '/api/shop/product/detail',
  35. method: 'POST',
  36. data: {
  37. id: id
  38. },
  39. showLoading: true
  40. })