From ff9a439975b5c6e90bc33ae48cde2ca2b7443fad Mon Sep 17 00:00:00 2001 From: jmal Date: Fri, 14 Apr 2023 23:46:50 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShowFile/ShowFile.vue | 8 ++++++++ src/websocket/sockJS.js | 1 + 2 files changed, 9 insertions(+) diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 05556bc..b678fc0 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -916,6 +916,8 @@ export default { } Bus.$on('msg/file/change', (msg) => this.onmessage(msg)) + + Bus.$on('msg/file/operation/fault', (msg) => this.onmessageFault(msg)) }, beforeDestroy() { window.removeEventListener('keydown', this.keydown, false) @@ -991,6 +993,12 @@ export default { this.selectPin = false } }, + onmessageFault(msg) { + if ('fault' === msg) { + this.getFileList() + return + } + }, onmessage(msg) { let fileDoc = JSON.parse(msg.body) const url = msg.headers.url diff --git a/src/websocket/sockJS.js b/src/websocket/sockJS.js index f9ebe1c..a964906 100644 --- a/src/websocket/sockJS.js +++ b/src/websocket/sockJS.js @@ -56,6 +56,7 @@ function connect(username,token){ type: 'success', }); } else { + Bus.$emit('msg/file/operation/fault', 'fault') Bus.$notify({ title: `${doc.operation}失败`, dangerouslyUseHTMLString: true,