async getData() {
await this.Arr.forEach(async val => {
let obj = {};
let itemBody = {key:val}
let data = await post(this.dataUrl, itemBody, this.header);
console.log(data); if (data.result) {
obj[val] = data.result.res;
closeAry.push(obj);
}
}); this.closeAry = closeAry;
let setKey = this.getStorageKey()
wx.setStorageSync(setKey.toString(), closeAry)
}Arr 数组对应的是15条接口,本来想同步执行每个ajax,但是太慢。怎样让并发请求数据,返回结果在closeAry的顺序和Arr顺序对应?
添加回答
举报
0/150
提交
取消