// 如果要处理Promise抛出的异常的话,每个请求后面都得带上catch:
axios.get('xxxx').then((res) => {
  // 请求成功
  // DO STH
}).catch((err) => {
  console.log(err);
})

 

相关文章: