优化通知公告气泡框显示,SignalR接受消息格式修改

This commit is contained in:
2023-10-20 17:12:17 +08:00
parent 3550f07731
commit 7297634be5
4 changed files with 19 additions and 13 deletions
+6 -6
View File
@@ -22,11 +22,11 @@ export default {
webNotify({ title: title, body: data })
})
// 接受系统通知/公告
connection.on(MsgType.M004, (data1, data2) => {
// if (data.code == 200) {
useSocketStore().setUnreadNoticeList(data1)
useSocketStore().setReadNoticeList(data2)
// }
connection.on(MsgType.M004, (data) => {
if (data.code == 200) {
useSocketStore().setUnreadNoticeList(data.data.unReadNotifications)
useSocketStore().setReadNoticeList(data.data.readNotifications)
}
})
// 接受聊天数据
connection.on(MsgType.M005, (data) => {
@@ -49,7 +49,7 @@ export default {
connection.invoke('AllReadNotice')
},
ReadNotice(connection, noticeId) {
connection.invoke('ReadNotice', noticeId)
connection.invoke('ReadNotice', noticeId.toString())
}
}
const MsgType = {