美文网首页
KOA ctx.throw 会清空headers 导致cors请

KOA ctx.throw 会清空headers 导致cors请

作者: BackSpeCe | 来源:发表于2017-11-18 13:27 被阅读0次

    用axios发post请求给自己写的koa2后端,成功的请求没啥问题,失败的请求(400,401)死活都拿不到response里的status code。 也就没法稳定可靠的基于返回的错误代码做判断触发下一步的操作。暂时用ctx.status 代替,发现啥问题再来更新。 

    相关文章

      网友评论

          本文标题:KOA ctx.throw 会清空headers 导致cors请

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