Skip to content
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

判断接口返回错误,判断的是http状态码, #82

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
判断接口返回错误,判断的是http状态码,
判断接口返回正常,现在用的是data中的code,
难道不应该保持一致吗?
  • Loading branch information
Samsung T5 - Program authored and Samsung T5 - Program committed Aug 28, 2020
commit 1643b6be1462fe1d2abc4c6ffbcc84188f1e2ee0
2 changes: 1 addition & 1 deletion src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ instance.interceptors.response.use(
? [...successCode]
: [...[successCode]];
// 是否操作正常
if (codeVerificationArray.includes(code)) {
if (codeVerificationArray.includes(status)) {
return data;
} else {
handleCode(code, msg);
Expand Down