New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
axios响应拦截器优化建议 #250
Comments
我觉得这个你可以写成数组。只要是数组内的code值就都是正常返回值。但是对于项而言。后端的code不统一。很奇怪 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这里判断接口应答内容中的code字段
在axios的响应拦截器中,判断body中的code会出现接口兼容的问题,建议判断http应答的状态码,理由:工具类尽量避免业务处理,不管http状态码还是body中的状态码,都交给业务代码处理
比如图验接口应答里有就会报错
The text was updated successfully, but these errors were encountered: