// Promise.all(
// [
// Promise.reject({ code: 500, msg: "服务异常" }),
// Promise.resolve({ code: 200, list: [] }),
// Promise.resolve({ code: 200, list: [] })
// ].map(p => p.catch(e => e))
// )
// .then(res => {
// const [a, b, c] = res
// console.log(a)
// console.log(b)
// console.log(c)
// })
// .catch(error => {
// console.log("error=>", error);
// });
// Promise.all(
// [
// Promise.reject({ code: 500, msg: "服务异常" }),
// Promise.resolve({ code: 200, list: [] }),
// Promise.resolve({ code: 200, list: [] })
// ]
// )
// .then(res => {
// const [a, b, c] = res
// console.log(a)
// console.log(b)
// console.log(c)
// })
// .catch(error => {
// console.log("error=>", error);
// });
const params = {name:'zyz', city: 'beijing'}
const postInfo = (obj) => {
const reqa = Promise.resolve({code: 200, data: obj.name})
const reqb = Promise.resolve({code: 200, data: obj.city})
const reqc = Promise.resolve(obj)
// const reqb = Promise.reject({code: 400, data: '无权限'})
Promise.all([reqa, reqb]).then(res => {
console.log(res)
const [a, b] = res
reqc.then(res2 => console.log(res2))
}).catch(err => console.log(err))
}
postInfo(params)
console