在Ant-Design-Pro V6中使用@umijs/max的request响应401时错误处理 #12252
Unanswered
JiXingTeam
asked this question in
Q&A
Replies: 1 comment
-
非 200 应该会直接错误,这个是 use request 底层用的 axios 的默认性质决定的,默认情况下,axios 对非 200 状态码的响应都默认认为是错误的响应,会直接拋错,如果想避免这种行为,需要配置一个 所以现在基本上所有的请求都是 200 响应码,但是根据响应里的一个 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
在使用request时mock返回了401状态码,并没有经过拦截器和errorThrower直接进入errorHandler处理这是为什么
Beta Was this translation helpful? Give feedback.
All reactions