diff --git a/src/layout/components/TopNotice/index.vue b/src/layout/components/TopNotice/index.vue index d0f41064..9a689898 100644 --- a/src/layout/components/TopNotice/index.vue +++ b/src/layout/components/TopNotice/index.vue @@ -126,19 +126,12 @@ export default { } }, initXDNoticSdk(){ - console.log("===>initXDNoticSdk==>") this.xdNoticSdk = this.$xdNoticeSdk; const userId=this.$store.getters.userId; - // const token=getToken(); - // console.log("===>userId==>",userId); - // this.xdNoticSdk.init(userId); this.xdNoticSdk.initWsPlus(userId); - - this.xdNoticSdk.setOnOpen(this.onNoticeOpen); this.xdNoticSdk.setOnClose(this.onNoticeClose); this.xdNoticSdk.setOnError(this.onNoticeError); - this.xdNoticSdk.setOnMessage(this.onMessage); }, @@ -191,6 +184,10 @@ export default { that.setAddReadTimes(noticeId); }, }); + + // 加载通知消息 + this.initUserNotice(); + }, setAddReadTimes(noticeId){ addReadTimes({"noticeId":noticeId}).then(response => { @@ -224,30 +221,8 @@ export default { }, showNotice(item){ - console.log("==showNotice===>xxx===>",item); this.setAddReadTimes(item.noticeId); }, - - - // notificationInfo(messageBody) { - // // this.speech.speak({ text: messageBody }).then(() => { - // // console.log("读取成功"); - // // }); - - // Notification.info({ - // title: "通知", - // dangerouslyUseHTMLString: true, - // message: messageBody.noticeContent, - // position: 'bottom-right', - // onClick: function () { - // //self.warnDetailByWarnid(messageBody.warnId); //自定义回调,message为传的参数 - // // 点击跳转的页面 - // }, - // }); - // }, - // join() { - // - // }, exit() { if (this.ws) { this.ws.close();