Commit 3c5ac846 by 前端

优化

1 parent 91e7612d
......@@ -46,8 +46,10 @@ export default {
this.polling()
// this.$sendSentry(`上传失败:文件名-${fileName} 错误码-${data.oss.res.status},失败原因-${JSON.stringify(data.oss.res)}`);
}
}catch(e) {
console.log(e)
} catch(e) {
this.$sendSentry(
`上传文件返回错误:${e}`
);
}
},
......@@ -235,10 +237,13 @@ export default {
flattenData(records) {
const result = records.reduce((acc, cur) => {
const recordUrlList = cur.recordUrlList.map(file => {
if(!file.status) {
return []
}
const aFullPath = file.file.split('/')
const fileName = aFullPath.pop()
const filePath = aFullPath.join('/') + '/'
return file.status ? { ...file, recordId: cur.id, fileName, filePath } : []
return { ...file, recordId: cur.id, fileName, filePath }
})
acc = acc.concat(...recordUrlList)
return acc
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!