优化通知公告显示,只保留显示几条消息弹窗,解决token过期后发请求报401错误会多次弹出登录状态已过期,请重新登录弹窗的问题

This commit is contained in:
2023-11-22 16:35:42 +08:00
parent 3c24343c5a
commit 54a76c6b4d
3 changed files with 25 additions and 20 deletions
+5 -8
View File
@@ -26,17 +26,14 @@ 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}的通知公告`
if (data.data.unReadNotifications.length > 0) {
ElNotification({
title: title,
message: ele.noticeContent,
title: import.meta.env.VITE_APP_TITLE,
message: `你有${data.data.unReadNotifications.length}条通知公告待查看`,
type: 'success',
duration: 0,
dangerouslyUseHTMLString: true
duration: 0
})
})
webNotify({ title: import.meta.env.VITE_APP_TITLE, body: `你有${data.data.unReadNotifications.length}条通知公告待查看` })
}
}
})
// 接受聊天数据