new Promise((res,rej)=>{
console.log("111111111")
let images = [];
images = that.data.addcfData[i].path
wx.uploadFile({
url: 'http://192.168.0.107:8082/task/info/save',
filePath: images,
name: 'file',
header:{"Content-Type": "multipart/form-data"},
formData: {
...formDatas,
createBy: userId,
applicantType
},
success: (uploadFileRes) => {
res(uploadFileRes)
},
fail:(e)=>{
rej(e)
},
});
}).then(res=>{
console.log(res)
let images = [];
images = that.data.addcfData[i].path
console.log(Array(images))
let taskId= JSON.parse(res.data).data;
console.log(taskId)
let arr =Array(images).slice(1).map(v=>{
console.log('11111111111111111111111')
return new Promise((res,rej)=>{
wx.uploadFile({
url: 'http://192.168.0.107:8082/common/sysFile/receiveFile',
filePath: v,
name: 'file',
header:{"Content-Type": "multipart/form-data"},
formData: {
infoId: taskId,
infoType: 0,
},
success: (uploadFileRes) => {
res(uploadFileRes)
} ,
fail:(e)=>{
rej(e)
},
});
})
})
Promise.all(arr).then(list=>{
}).catch(e=>{
})
})
then之后,let arr=Array 没有执行,有大佬指点吗?