From 186d6b6937d69a729543f7f3286f7d61a0adf746 Mon Sep 17 00:00:00 2001 From: jmal Date: Sun, 7 Jul 2024 00:05:06 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sse/SSEClient.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sse/SSEClient.js b/src/sse/SSEClient.js index e60e0fa..3f428df 100644 --- a/src/sse/SSEClient.js +++ b/src/sse/SSEClient.js @@ -93,6 +93,18 @@ function handleFileChangeMessage(msg, url, body) { store.dispatch('updateMessage', { event: 'msg/file/operation/fault', data: msg }); } } + + if (url === 'operationTips') { + const { operation, success, msg: message } = body + const notificationOptions = { + title: `${operation} ${success ? '成功' : '失败'}`, + dangerouslyUseHTMLString: true, + message: success ? '' : message ? `${message}` : '', + type: success ? 'success' : 'error', + } + Bus.notify(notificationOptions) + } + } export function initiateSSE(username) {