优化通知公告显示,只保留显示几条消息弹窗,解决token过期后发请求报401错误会多次弹出登录状态已过期,请重新登录弹窗的问题
This commit is contained in:
@@ -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}条通知公告待查看` })
|
||||
}
|
||||
}
|
||||
})
|
||||
// 接受聊天数据
|
||||
|
||||
Reference in New Issue
Block a user