{"code":15,"message":"targetSdkVersion设置>=29后在Android10+系统设备不支持当前路径。请更改为应用运行路径!具体请看:https://ask.dcloud.net.cn/article/36199"}
调用的带代码如下,
plus.io.resolveLocalFileSystemURL(
filePath, // 指定的目录
function (entry) {
var directoryReader = entry.createReader() // 获取读取目录对象
directoryReader.readEntries(
function (entries) {
// 历遍子目录即可
console.log(entries)
var count = 0 // 记录多少条 用于处理循环跳出
var total_count = entries.length
for (var i = 0; i < entries.length; i++) {
count++
let file_name = entries[total_count-count].name
file_name = trim(file_name, 'g')
if (count > 5) {
clearInterval(_this.uploadEvent)
break
}
var uploadFilePath = filePath + '/' + entries[total_count-count].name
checkFileSizeIsChange(uploadFilePath, entries[total_count-count])
}
if (entries.length == 0) {
clearInterval(_this.uploadEvent)
}
},
function (err) {
console.log('err', err);
clearInterval(_this.uploadEvent)
console.log('访问目录失败1')
},
)
},
function (err) {
clearInterval(_this.uploadEvent)
console.log('访问指定目录失败:' + err.message)
},
)
1 个回复
笑少 (作者)
请大神帮忙处理一下,谢谢