修复运维中心中开启历史日志后再开启实时日志连接失败

This commit is contained in:
648540858
2024-11-04 10:15:45 +08:00
parent 2161cf6866
commit 2c4311b58c
3 changed files with 8 additions and 5 deletions

View File

@@ -32,6 +32,7 @@ export default {
filter: "",
logData: "",
websocket: null,
destroyedCallback: null
};
},
watch: {
@@ -61,7 +62,9 @@ export default {
},
destroyed() {
console.log('destroyed');
window.websocket.close();
if (this.destroyedCallback) {
this.destroyedCallback()
}
},
methods: {
initData: function () {
@@ -101,6 +104,9 @@ export default {
}
window.websocket.onopen = e => {
console.log(`conn open: ${e}`);
this.destroyedCallback = ()=>{
window.websocket.close()
}
}
}
},

View File

@@ -18,8 +18,8 @@ export default {
winHeight: window.innerHeight - 220,
};
},
created() {
console.log("removeUrl11 == " + this.removeUrl)
},
methods: {
getURl: function () {