美文网首页
axiso在服务器错误时,取不到response

axiso在服务器错误时,取不到response

作者: 剑圣_盖小聂 | 来源:发表于2020-11-04 15:25 被阅读0次

想在后端返回错误码401的时候退出登录,但是进不到response里面,如图:

进不到我想进行的操作

然后在error里面输出发现输出的时Error对象,通过error里的response判断响应信息就可以了,如图:

失效时的操作 error.response对象

相关文章

网友评论

      本文标题:axiso在服务器错误时,取不到response

      本文链接:https://www.haomeiwen.com/subject/nslbvktx.html