From 423594e20c58ef682d40f9a6a96b7d3f34a9acbf Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 2 Aug 2023 00:29:00 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20ai=E8=81=8A=E5=A4=A9=E5=B0=8F=E6=A6=82?= =?UTF-8?q?=E7=8E=87=E5=87=BA=E7=8E=B0=E9=87=8D=E5=A4=8D=E6=8E=A8=E6=B5=81?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/store/actions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index dd7666f7e..9f8df5ceb 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -2858,6 +2858,9 @@ export default { if (!/^https*:\/\//i.test(streamUrl)) { streamUrl = $A.apiUrl(`..${streamUrl}`) } + if (state.dialogSseList.find(item => item.streamUrl == streamUrl)) { + return + } const sse = new SSEClient(streamUrl) sse.subscribe(['append', 'replace', 'done'], (type, e) => { switch (type) { @@ -2886,7 +2889,7 @@ export default { break; } }) - state.dialogSseList.push({sse, time: $A.Time()}) + state.dialogSseList.push({sse, streamUrl, time: $A.Time()}) if (state.dialogSseList.length > 10) { state.dialogSseList.shift().sse.close() }