Skip to content

Commit f493743

Browse files
committed
feat(uploader): 图片优先使用本地路径
close #132
1 parent 40a7827 commit f493743

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/uploader/uploader.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ Component({
129129
const files = res.tempFilePaths.map((item, i) => ({
130130
loading: true,
131131
// @ts-ignore
132-
url: `data:image/jpg;base64,${wx.arrayBufferToBase64(contents[i])}`
132+
url:
133+
res.tempFilePaths[i] ||
134+
`data:image/jpg;base64,${wx.arrayBufferToBase64(contents[i])}`
133135
}))
134136
if (!files || !files.length) return
135137
if (typeof this.data.upload === 'function') {

0 commit comments

Comments
 (0)