Commit 098d35a5 by 李伟康

commit 提交

1 parent 4de9ed08
...@@ -57,7 +57,10 @@ const imgToBase64 = (list, urlKey) => { ...@@ -57,7 +57,10 @@ const imgToBase64 = (list, urlKey) => {
responseType: 'arraybuffer', responseType: 'arraybuffer',
success: (res) => { success: (res) => {
const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}` const base64 = `data:image/png;base64,${uni.arrayBufferToBase64(res.data)}`
if (urlKey) newList[index][urlKey] = base64 if (urlKey) {
newList[index][urlKey] = base64
newList[index][`original_${urlKey}`] = e[urlKey]
}
else newList[index] = base64 else newList[index] = base64
arr.push(e) arr.push(e)
if (arr.length === list.length) resolve(newList) if (arr.length === list.length) resolve(newList)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!