修改禅道已知问题

This commit is contained in:
qq787203167
2022-03-11 10:18:15 +08:00
parent 6a2726d2cc
commit 4f20d5b922
+8 -25
View File
@@ -45,7 +45,7 @@
export default { export default {
name: 'HeaderNotice', name: 'HeaderNotice',
components: { components: {
DynamicNotice, DynamicNotice
}, },
data() { data() {
return { return {
@@ -54,14 +54,14 @@
listCementByUser: '/sys/sysAnnouncementSend/getMessageUnreadList', listCementByUser: '/sys/sysAnnouncementSend/getMessageUnreadList',
editCementSend: '/sys/sysAnnouncementSend/editByAnntIdAndUserId', editCementSend: '/sys/sysAnnouncementSend/editByAnntIdAndUserId',
queryById: '/sys/annountCement/queryById', queryById: '/sys/annountCement/queryById',
readAllMsg:'sys/sysAnnouncementSend/read', readAllMsg: 'sys/sysAnnouncementSend/read'
}, },
hovered: false, hovered: false,
announcement1: [], announcement1: [],
announcement2: [], announcement2: [],
msg1Count: '0', msg1Count: '0',
msg2Count: '0', msg2Count: '0',
msg1Title: this.$t('MessageNotification')+'(0)', msg1Title: this.$t('MessageNotification') + '(0)',
msg2Title: '', msg2Title: '',
stopTimer: false, stopTimer: false,
websock: null, websock: null,
@@ -86,17 +86,6 @@
this.websocketOnclose() this.websocketOnclose()
}, },
methods: { methods: {
timerFun() {
this.stopTimer = false
let myTimer = setInterval(() => {
// 停止定时器
if (this.stopTimer == true) {
clearInterval(myTimer)
return
}
this.loadData()
}, 6000)
},
loadData() { loadData() {
try { try {
// 获取系统消息 // 获取系统消息
@@ -104,7 +93,7 @@
if (res.success) { if (res.success) {
this.announcement1 = res.result this.announcement1 = res.result
this.msg1Count = res.result.length this.msg1Count = res.result.length
this.msg1Title = this.$t('MessageNotification')+'(' + res.result.length + ')' this.msg1Title = this.$t('MessageNotification') + '(' + res.result.length + ')'
} }
}).catch(error => { }).catch(error => {
this.stopTimer = true this.stopTimer = true
@@ -158,16 +147,9 @@
this.reconnect() this.reconnect()
}, },
websocketOnmessage: function(e) { websocketOnmessage: function(e) {
console.log(e) console.log('-----接收消息-------', e)
console.log('-----接收消息-------', e.data) //系统通知
var data = eval('(' + e.data + ')') //解析对象 this.loadData()
if (data.cmd == 'topic') {
//系统通知
this.loadData()
} else if (data.cmd == 'user') {
//用户消息
this.loadData()
}
}, },
websocketOnclose: function(e) { websocketOnclose: function(e) {
console.log('connection closed (' + e + ')') console.log('connection closed (' + e + ')')
@@ -198,6 +180,7 @@
heartCheckFun() { heartCheckFun() {
var that = this var that = this
//心跳检测,每20s心跳一次 //心跳检测,每20s心跳一次
console.log(123)
that.heartCheck = { that.heartCheck = {
timeout: 20000, timeout: 20000,
timeoutObj: null, timeoutObj: null,