素材库

This commit is contained in:
yanran200730
2023-03-03 13:48:14 +08:00
parent cec0cf34e4
commit 1b95c37826
3 changed files with 61 additions and 45 deletions

View File

@@ -350,14 +350,29 @@ export default {
this.$message.success('上传成功')
return false
}
let data = res.data[0].split(';')
this.fileList.forEach(item => {
if (item.uid === file.file.uid) {
item.id = data[1]
item.path = data[0]
item.url = data[0]
}
})
if (Object.prototype.toString.call(res.data) === '[object Object]') {
this.fileList.forEach(item => {
if (item.uid === file.file.uid) {
item.id = res.data.id
item.path = res.data.url
item.url = res.data.url
item.url = res.data.url
item.fileSizeStr = res.data.fileSizeStr
item.postfix = res.data.postfix
}
})
} else {
let data = res.data[0].split(';')
this.fileList.forEach(item => {
if (item.uid === file.file.uid) {
item.id = data[1]
item.path = data[0]
item.url = data[0]
}
})
}
this.emitChange(this.fileList)
this.$message.success('上传成功')
}