a plurality of request interfaces axios

axios.all ([

    axios.get('https://api.github.com/xxx/1'),

    axios.get('https://api.github.com/xxx/2')

  ])

  .then(axios.spread(function (userResp, reposResp) {

    // After the above two requests are completed, before the implementation of this callback method

    console.log('User', userResp.data);

    console.log('Repositories', reposResp.data);

  }));

Guess you like

Origin www.cnblogs.com/yangsg/p/12017801.html