im.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import request from '@/utils/request'
  2. export function getContacts(deviceId) {
  3. return request({
  4. url: '/qw/contact/list/'+deviceId,
  5. method: 'get'
  6. })
  7. }
  8. export function getContactsByUser(userId) {
  9. return request({
  10. url: '/qw/contact/listByUser/'+userId,
  11. method: 'get'
  12. })
  13. }
  14. export function getConversations(userId) {
  15. return request({
  16. url: '/qw/qwMsg/conversationList/'+userId,
  17. method: 'get'
  18. })
  19. }
  20. export function getConversation(query) {
  21. return request({
  22. url: '/qw/qwMsg/getSession',
  23. method: 'get',
  24. params:query
  25. })
  26. }
  27. export function getMessageList(query) {
  28. return request({
  29. url: '/qw/qwMsg/getQwMessageListBySession',
  30. method: 'get',
  31. params: query
  32. })
  33. }
  34. export function getQwUserList() {
  35. return request({
  36. url: '/qw/qwMsg/qwUserList',
  37. method: 'get',
  38. })
  39. }
  40. // 发送文本消息
  41. export function sendMsg(data) {
  42. return request({
  43. url: '/qw/qwMsg/sendMsg',
  44. method: 'post',
  45. data: data
  46. })
  47. }
  48. // 发送文本消息
  49. export function sendImageMsg(data) {
  50. return request({
  51. url: '/qw/message/image',
  52. method: 'post',
  53. data: data
  54. })
  55. }
  56. export function getRoomInfo(roomId) {
  57. return request({
  58. url: '/qw/room/roomDetail/'+roomId,
  59. method: 'get'
  60. })
  61. }
  62. //导出消息
  63. export function exportMessage(query) {
  64. return request({
  65. url: '/qw/message/export/',
  66. method: 'get',
  67. params: query
  68. })
  69. }