Promise解决某个条件需要多个异步结果的问题

来源:互联网 发布:vb编程入门 编辑:程序博客网 时间:2024/05/01 01:26
 let p1 = getjson(url, {}).then(function(res) {        return res;    });    let p2 = getjson(url, {        'entname': '',        'page': 1,        'pageSize': 10    }).then(function(res) {        return res;    });    Promise.all([p1, p2]).then((p1res) => {        console.log('p1::' + JSON.stringify(p1res[0].responseData));        console.log('p12::' + JSON.stringify(p1res[1].responseData));    });

0 0