axios Promise 响应封装
axios
axios也是返回一个promise对象,他会封装两个结果,成功即为response,需要取出从服务器获得的响应数据,response.data。失败为error,需要获取为error.message。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 小贺同学的blog!
评论
axios也是返回一个promise对象,他会封装两个结果,成功即为response,需要取出从服务器获得的响应数据,response.data。失败为error,需要获取为error.message。