通知公告增加右上角弹窗提醒,及浏览器通知

This commit is contained in:
2023-11-22 10:38:04 +08:00
parent 1d179c2105
commit 3c24343c5a
3 changed files with 15 additions and 4 deletions
+11
View File
@@ -26,6 +26,17 @@ export default {
if (data.code == 200) {
useSocketStore().setUnreadNoticeList(data.data.unReadNotifications)
useSocketStore().setReadNoticeList(data.data.readNotifications)
data.data.unReadNotifications.forEach((ele) => {
const title = `来自${ele.create_name}的通知公告`
ElNotification({
title: title,
message: ele.noticeContent,
type: 'success',
duration: 0,
dangerouslyUseHTMLString: true
})
})
webNotify({ title: import.meta.env.VITE_APP_TITLE, body: `你有${data.data.unReadNotifications.length}条通知公告待查看` })
}
})
// 接受聊天数据