Axios 一次性请求多个接口

const url = "http://localhost:10010"

const course = axios.get(url + "/course-service/course")
const classes = axios.get(url + "/classes-service/class")

axios.all([course, classes]).then(res=>{
    console.log(res[0]); // course
    console.log(res[1]); // classse
})
评论区
头像