res.tempFilePaths.map(tempFilePath => () => new AV.File('filename', {
blob: {
uri: tempFilePath,
},
}).save()).reduce(
(m, p) => m.then(v => AV.Promise.all([...v, p()])),
AV.Promise.resolve([])
).then(files => console.log(files.map(file => file.url()))).catch(console.error);
比如这样会报错:
that.data.housePicturePaths.map(function (tempFilePath) {
var file = new AV.File("fileName", {
blob: {
uri: tempFilePath,
},
})
file.setACL(acl);
file.save().then(function (file) {
}, function (error) {})
}).reduce(
(m, p) => m.then(v => AV.Promise.all([...v, p()])),
AV.Promise.resolve([])
).then(function(files){