product.js 862 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import request from '@/utils/request'
  2. const baseUrl = import.meta.env.VITE_APP_BASE_API
  3. // 查询产品管理列表
  4. export function listProduct(query) {
  5. return request({
  6. url: baseUrl + '/base/product/list',
  7. method: 'get',
  8. params: query
  9. })
  10. }
  11. // 查询产品管理详细
  12. export function getProduct(id) {
  13. return request({
  14. url: baseUrl + '/base/product/' + id,
  15. method: 'get'
  16. })
  17. }
  18. // 新增产品管理
  19. export function addProduct(data) {
  20. return request({
  21. url: baseUrl + '/base/product',
  22. method: 'post',
  23. data: data
  24. })
  25. }
  26. // 修改产品管理
  27. export function updateProduct(data) {
  28. return request({
  29. url: baseUrl + '/base/product',
  30. method: 'put',
  31. data: data
  32. })
  33. }
  34. // 删除产品管理
  35. export function delProduct(id) {
  36. return request({
  37. url: baseUrl + '/base/product/' + id,
  38. method: 'delete'
  39. })
  40. }