使用Promise发送多个异步请求, 全部完成后再执行
const datas = idList .map(id => url+'/id') .map(url => fetch(url).then(res => res.json())); const p = new Promise.all(datas) .then(data => {...}) const datas = idList .map(id => url+'/id') .map(url => fetch(url).then(res => res.json())); const foo = await Promise.all(datas); const series = foo.map(data => {...})