我有一个循环请求数据列表的功能,但是有时返回的数据列表展现的顺序不一致
有什么方法能让他固定按序展示
let orderList = ['af123sdfs33242','sdf3323sdfsdfsd'].split(',');
let query = null ;
for(let id of orderList) {
query = HttpServerObj.getByJSON(CONFIG.payDetail + id)
.then((result) => {
if (result.code === '200') {
this.state.payDetail.push(result.data);
}
});
}
return query;
如果循环体内部用async/await呢?