提交 13f78be7 编写于 作者: Q qiang

fix: 修复 uni.saveFile 循环调用可能失败的问题 question/106233

上级 20d501d0
......@@ -20,12 +20,13 @@ function getSavedFileDir (success, fail) {
}, fail)
}
let index = 0
export function saveFile ({
tempFilePath
} = {}, callbackId) {
const errorCallback = warpPlusErrorCallback(callbackId, 'saveFile')
let fileName = getFileName(tempFilePath)
fileName = `${Date.now()}_${fileName}`
fileName = `${Date.now()}${index++}_${fileName}`
plus.io.resolveLocalFileSystemURL(tempFilePath, entry => { // 读取临时文件 FileEntry
getSavedFileDir(dir => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册