We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
这里判断接口应答内容中的code字段 在axios的响应拦截器中,判断body中的code会出现接口兼容的问题,建议判断http应答的状态码,理由:工具类尽量避免业务处理,不管http状态码还是body中的状态码,都交给业务代码处理
// 未设置状态码则默认成功状态 const code = res.status || 200;
比如图验接口应答里有就会报错
{"code":"1234","uuid":"xxxxxx","img":"xxxxxxxx"}
The text was updated successfully, but these errors were encountered:
我觉得这个你可以写成数组。只要是数组内的code值就都是正常返回值。但是对于项而言。后端的code不统一。很奇怪
Sorry, something went wrong.
No branches or pull requests
这里判断接口应答内容中的code字段
在axios的响应拦截器中,判断body中的code会出现接口兼容的问题,建议判断http应答的状态码,理由:工具类尽量避免业务处理,不管http状态码还是body中的状态码,都交给业务代码处理
比如图验接口应答里有就会报错
The text was updated successfully, but these errors were encountered: