From 30849416b6d7ba2e4fea023b3c490547fb2c8e33 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 11 Oct 2024 14:12:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E5=85=B7ps/net=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=AE=9A=E6=97=B6=E5=99=A8=E6=B8=85=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/net/index.vue | 3 +++ src/views/tool/ps/index.vue | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/views/tool/net/index.vue b/src/views/tool/net/index.vue index 0b765a67..2fcef6fb 100644 --- a/src/views/tool/net/index.vue +++ b/src/views/tool/net/index.vue @@ -78,6 +78,7 @@ function fnRealTime(reLink: boolean) { /**调度器周期变更*/ function fnIntervalChange(v: any) { clearInterval(state.interval); + state.interval = null; const timer = parseInt(v); if (timer > 1_000) { state.intervalTime = v; @@ -232,6 +233,8 @@ onMounted(() => { /**钩子函数,界面关闭*/ onBeforeUnmount(() => { + clearInterval(state.interval); + state.interval = null; ws.close(); }); diff --git a/src/views/tool/ps/index.vue b/src/views/tool/ps/index.vue index 162c5c1b..8587cddf 100644 --- a/src/views/tool/ps/index.vue +++ b/src/views/tool/ps/index.vue @@ -80,6 +80,7 @@ function fnRealTime(reLink: boolean) { /**调度器周期变更*/ function fnIntervalChange(v: any) { clearInterval(state.interval); + state.interval = null; const timer = parseInt(v); if (timer > 1_000) { state.intervalTime = v; @@ -265,6 +266,8 @@ onMounted(() => { /**钩子函数,界面关闭*/ onBeforeUnmount(() => { + clearInterval(state.interval); + state.interval = null; ws.close(); });