style: 优化操作失败的提示

This commit is contained in:
jmal 2023-04-14 23:46:50 +08:00
parent ac421e1161
commit ff9a439975
2 changed files with 9 additions and 0 deletions

View File

@ -916,6 +916,8 @@ export default {
} }
Bus.$on('msg/file/change', (msg) => this.onmessage(msg)) Bus.$on('msg/file/change', (msg) => this.onmessage(msg))
Bus.$on('msg/file/operation/fault', (msg) => this.onmessageFault(msg))
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('keydown', this.keydown, false) window.removeEventListener('keydown', this.keydown, false)
@ -991,6 +993,12 @@ export default {
this.selectPin = false this.selectPin = false
} }
}, },
onmessageFault(msg) {
if ('fault' === msg) {
this.getFileList()
return
}
},
onmessage(msg) { onmessage(msg) {
let fileDoc = JSON.parse(msg.body) let fileDoc = JSON.parse(msg.body)
const url = msg.headers.url const url = msg.headers.url

View File

@ -56,6 +56,7 @@ function connect(username,token){
type: 'success', type: 'success',
}); });
} else { } else {
Bus.$emit('msg/file/operation/fault', 'fault')
Bus.$notify({ Bus.$notify({
title: `${doc.operation}失败`, title: `${doc.operation}失败`,
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,