import axios from 'axios'
const urls = [url1, url2, url3]
const ajaxUrls = urls.map(url => {
return new Promise((resolve, reject) => {
axios
.get(url)
.then(res => reject(res))
.catch(err => resolve(err))
})
})
Promise
.all(ajaxUrls)
.then(err => {
// 错误处理的代码
})
.catch(res => {
// 处理 正常数据
})