calling-message.js 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * 留言接口请求
  3. * @param params
  4. * @returns {Promise<any>}
  5. */
  6. import request from '@/utils/request'
  7. export function getList(params) {
  8. return request({
  9. url: '/mgr/message/page',
  10. method: 'POST',
  11. loading: true,
  12. data: params,
  13. headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
  14. })
  15. }
  16. /** 新增留言 */
  17. export function add(params) {
  18. return request({
  19. url: '/mgr/message',
  20. method: 'POST',
  21. loading: true,
  22. data: params
  23. })
  24. }
  25. /** 删除留言 */
  26. export function remove(params) {
  27. const ids = params.toString()
  28. return request({
  29. url: `/mgr/message/${ids}`,
  30. method: 'DELETE',
  31. loading: true,
  32. data: params
  33. })
  34. }
  35. /** 更新留言 */
  36. export function update(id, params) {
  37. return request({
  38. url: `/mgr/message/${id}`,
  39. method: 'put',
  40. data: params
  41. })
  42. }
  43. /** 查询单个留言 */
  44. export function get(id, params) {
  45. return request({
  46. url: `/mgr/message/${id}`,
  47. method: 'get',
  48. loading: false,
  49. params
  50. })
  51. }