Skip to content

Commit

Permalink
fix: 🧩 修复loading请求bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Halsey committed Jun 9, 2022
1 parent e98c035 commit a3270ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RequestHttp {
const { data, config } = response;
// * 在请求结束后,移除本次请求
axiosCanceler.removePending(config);
config.headers!.noLoading || tryHideFullScreenLoading();
tryHideFullScreenLoading();
// * 登陆失效(code == 599)
if (data.code == ResultEnum.OVERDUE) {
ElMessage.error(data.msg);
Expand All @@ -76,7 +76,7 @@ class RequestHttp {
},
async (error: AxiosError) => {
const { response } = error;
config.headers!.noLoading || tryHideFullScreenLoading();
tryHideFullScreenLoading();
// 根据响应的错误状态码,做不同的处理
if (response) return checkStatus(response.status);
// 服务器结果都没有返回(可能服务器错误可能客户端断网),断网处理:可以跳转到断网页面
Expand Down

0 comments on commit a3270ec

Please sign in to comment.