Commit 3c5ac846 by 前端

优化

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