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,