comment.js 833 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { axios } from '@/utils/request'
  2. export function fetchCommentLists (query) {
  3. return axios({
  4. url: '/comments/comments/v1/list',
  5. method: 'get',
  6. params: query
  7. })
  8. }
  9. export function fetchCommentList (query) {
  10. return axios({
  11. url: '/comments/comments/v1/list',
  12. method: 'get',
  13. params: query
  14. })
  15. }
  16. export function replyComment (data) {
  17. return axios({
  18. url: '/comments/admin/v1/reply',
  19. method: 'post',
  20. data
  21. })
  22. }
  23. export function fetchComment (id) {
  24. return axios({
  25. url: `/comments/comments/v1/${id}`,
  26. method: 'get'
  27. })
  28. }
  29. export function updateComment (data) {
  30. return axios({
  31. url: '/comments/comments/v1/update',
  32. method: 'put',
  33. data
  34. })
  35. }
  36. export function deleteComment (id) {
  37. return axios({
  38. url: `/comments/comments/v1/${id}`,
  39. method: 'delete'
  40. })
  41. }