This commit is contained in:
linfso 2025-01-04 14:06:45 +08:00
parent 2ee641b462
commit 99e98146c1

View File

@ -91,6 +91,8 @@ export default {
alertList:[],
noReadNoticeCount:0,
noticeList: [],
// 剔除重复消息
filterMap:new Map(),
xdNoticSdk:null,
@ -160,12 +162,20 @@ export default {
return;
}
this.playTone();
// this.playTone();
var messageBody = evt.title;
let noticeId= evt.noticeId;
// Notification.closeAll();
// 如果有重复消息,则过滤
if(this.filterMap.has(messageBody)) { // 如果有该key值
return ;
}
this.filterMap.set(messageBody, true);
// Notification.closeAll();
// this.speech.speak({ text: messageBody }).then(() => {
// console.log("读取成功");
// });