时间:2019-05-03 来源:小程序工厂
然后我有个循环是这样的
for(let i of imgObj.other){
if(i.length==2){
let cloudPath = i[1]
let filePath = i[0]
wx.cloud.uploadFile({ cloudPath, filePath }).then(r => {
imgs.other.push(r.fileID)
})
}else{
imgs.other.push(i[0])
}
}
,建议可循环上传
if (imgObj.fixtureList.length == 2){
imgsOk[5] = false
let cloudPath = imgObj.fixtureList[1]
let filePath = imgObj.fixtureList[0]
wx.cloud.uploadFile({ cloudPath, filePath }).then(r => { imgs.fixtureList = r.fileID, imgsOk[5] = true })
}
if (imgObj.awards.length == 2) {
imgsOk[6] = false
let cloudPath = imgObj.awards[1]
let filePath = imgObj.awards[0]
wx.cloud.uploadFile({ cloudPath, filePath }).then(r => { imgs.awards = r.fileID, imgsOk[6] = true })
}
我是在一个方法里 满足条件才上传一张
触发一次方法 满足10个条件 就触发wx.cloud.uploadFile({ cloudPath, filePath }).then(r => { imgs.awards = r.fileID }) 10次
这也受并发上限么?