mynews.api.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { defHttp } from '/@/utils/http/axios';
  2. import { Modal } from 'ant-design-vue';
  3. enum Api {
  4. list = '/sys/sysAnnouncementSend/getMyAnnouncementSend',
  5. editCementSend = '/sys/sysAnnouncementSend/editByAnntIdAndUserId',
  6. readAllMsg = '/sys/sysAnnouncementSend/readAll',
  7. syncNotic = '/sys/annountCement/syncNotic',
  8. }
  9. /**
  10. * 查询消息列表
  11. * @param params
  12. */
  13. export const getMyNewsList = (params) => {
  14. return defHttp.get({ url: Api.list, params });
  15. };
  16. /**
  17. * 更新用户系统消息阅读状态
  18. * @param params
  19. */
  20. export const editCementSend = (params) => {
  21. return defHttp.put({ url: Api.editCementSend, params });
  22. };
  23. /**
  24. * 一键已读
  25. * @param params
  26. */
  27. export const readAllMsg = (params, handleSuccess) => {
  28. Modal.confirm({
  29. title: '确认操作',
  30. content: '是否全部标注已读?',
  31. okText: '确认',
  32. cancelText: '取消',
  33. onOk: () => {
  34. return defHttp.put({ url: Api.readAllMsg, data: params }, { joinParamsToUrl: true }).then(() => {
  35. handleSuccess();
  36. });
  37. },
  38. });
  39. };
  40. /**
  41. * 同步消息
  42. * @param params
  43. */
  44. export const syncNotic = (params) => {
  45. return defHttp.get({ url: Api.syncNotic, params });
  46. };