Closed nikojxie closed 5 years ago
状态码非200-299 请求都是失败的 这时候data实际不存在 根本没传输过来 为什么要呢
后台会封装一些报错信息,比如status是401,报错信息就会返回给前台,是登录过期 有些报错信息需要后台定义 前端展示给用户 这部分信息是在bmAxios.fetch封装的时候就抛掉了吗
Thanks for your help😊
既然请求已到达后端说明 http请求是成功了,此时 http status 就应该是 200,不要修改http协议默认的状态码,你们的data节点不是有 code 字段吗?为什么不用这个code来作业务,而要修改http协议的状态码?eros 底层有封装,非200 就不回返回数据,你可以自己修改一下
好的 谢谢你
使用bmAxios的fetch,当状态码不在 200-299之间时,无法获得返回的data,只有状态码status和errorMsg,而使用weex官方的 stream.fetch 时,可以获得