1.优化
This commit is contained in:
2025-07-08 17:50:37 +08:00
parent 7565056a7e
commit f6e5bb78da
8 changed files with 39 additions and 28 deletions
+2
View File
@@ -354,6 +354,8 @@
}
onUnmounted(() => {
if (qhInterval.value) clearInterval(qhInterval.value);
if (cInterval.value) clearInterval(cInterval.value);
// 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
window.onbeforeunload = function () {
closeSocket();