spu.js 757 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import request from '@/utils/request'
  2. // 创建商品spu
  3. export function createSpu(data) {
  4. return request({
  5. url: '/product/spu/create',
  6. method: 'post',
  7. data: data
  8. })
  9. }
  10. // 更新商品spu
  11. export function updateSpu(data) {
  12. return request({
  13. url: '/product/spu/update',
  14. method: 'put',
  15. data: data
  16. })
  17. }
  18. // 删除商品spu
  19. export function deleteSpu(id) {
  20. return request({
  21. url: '/product/spu/delete?id=' + id,
  22. method: 'delete'
  23. })
  24. }
  25. // 获得商品spu
  26. export function getSpu(id) {
  27. return request({
  28. url: '/product/spu/get?id=' + id,
  29. method: 'get'
  30. })
  31. }
  32. // 获得商品spu分页
  33. export function getSpuPage(query) {
  34. return request({
  35. url: '/product/spu/page',
  36. method: 'get',
  37. params: query
  38. })
  39. }