fix: 补充知识库上传失败后的提示

This commit is contained in:
chenjinsong
2023-09-04 15:24:29 +08:00
parent 4a57792f76
commit ac3eb9061e
2 changed files with 16 additions and 4 deletions

View File

@@ -257,9 +257,15 @@ export default {
fileChange (files, fileList) { fileChange (files, fileList) {
this.fileList = fileList.slice(-1) this.fileList = fileList.slice(-1)
}, },
uploadError () { uploadError (error) {
let errorMsg
if (error.message) {
errorMsg = JSON.parse(error.message).message
} else {
errorMsg = 'error'
}
this.uploadLoading = false this.uploadLoading = false
this.$message.error(this.$t('tip.uploadFailed', { msg: 'error' })) this.$message.error(this.$t('tip.uploadFailed', { msg: errorMsg }))
}, },
uploadSuccess (response) { uploadSuccess (response) {
this.uploadLoading = false this.uploadLoading = false

View File

@@ -512,9 +512,15 @@ export default {
} }
this.fileList = fileList.slice(-1) this.fileList = fileList.slice(-1)
}, },
uploadError () { uploadError (error) {
let errorMsg
if (error.message) {
errorMsg = JSON.parse(error.message).message
} else {
errorMsg = 'error'
}
this.uploadLoading = false this.uploadLoading = false
this.$message.error(this.$t('tip.uploadFailed', { msg: 'error' })) this.$message.error(this.$t('tip.uploadFailed', { msg: errorMsg }))
}, },
handleSpeticalTypeData (originalImportedData) { handleSpeticalTypeData (originalImportedData) {
originalImportedData.forEach(item => { originalImportedData.forEach(item => {