category.js 717 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // 查询列表接口
  2. const getCategoryPage = (params) => {
  3. return $axios({
  4. url: '/category/page',
  5. method: 'get',
  6. params
  7. })
  8. }
  9. // 编辑页面反查详情接口
  10. const queryCategoryById = (id) => {
  11. return $axios({
  12. url: `/category/${id}`,
  13. method: 'get'
  14. })
  15. }
  16. // 删除当前列的接口
  17. const deleCategory = (ids) => {
  18. return $axios({
  19. url: '/category',
  20. method: 'delete',
  21. params: { ids }
  22. })
  23. }
  24. // 修改接口
  25. const editCategory = (params) => {
  26. return $axios({
  27. url: '/category',
  28. method: 'put',
  29. data: { ...params }
  30. })
  31. }
  32. // 新增接口
  33. const addCategory = (params) => {
  34. return $axios({
  35. url: '/category',
  36. method: 'post',
  37. data: { ...params }
  38. })
  39. }