import { $fytz } from '../index'; const id = 'BbEfZ4izeR4TEZ2N'; const name = 'pcheck'; export default { /** * 获取通知历史记录 */ getNoticeHistory({ type, subtype = null, page = 1, perPage = 20 }) { const params = `userId=${id}&page=${page}&per_page=${perPage}`; return $fytz .post(`notifications/history?${params}`, { ecNoticetype: type, ecNoticesubtype: subtype }) .then((res) => res.data); }, /** * 获取用户未读通知 */ getNotification() { return $fytz .get('notifications', { params: { userId: id, page: 1, per_page: 30 } }) .then((res) => res.data); }, /** * 发布通知 * @param { //发布者id authorId: '', //发布者名字 authorName: '', //通知类型数组 _typeArray: [0], //通知类型id typeId: '', //通知子类型id subTypeId: '', //通知标题 title: '', //通知内容 content: '', //通知图片 picUrl: '', //通知链接 bodyUrl: '', //是否需要签收 needSigned: false, //接受用户场景类型 receiverType: '0', //接受用户区县 district: '0', //接受用户id receiverId: '', } */ releaseNotice(notice) { notice.authorId = id; notice.authorName = name; return $fytz.post(`notifications/${id}/release2`, notice).then((res) => res.data); } };