fetch('http://10.3.134.173/jsonp-test/data/dish_getbypage.php?start=1',
).then((response)=>
response.json()
).then((res)=>{ console.log(res[0].name);
});
fetch('http://10.3.134.173/jsonp-test/data/dish_getbypage.php?start=2',
).then((response)=>
response.json()
).then((res)=>{ console.log(res[0].name);
})同時發起請求,比如一個等待一秒,一個等待兩秒返回,然后待都返回結果然后執行后續操作,具體該怎么操作,用promise.all怎么寫
待兩個接口都返回再操作的情況,怎么處理,有哪些解決方法
慕容森
2018-08-18 21:03:21