feat: 优化在微信小程序中接口返回的错误信息 会被uni.hideLoading取消展示错误信息问题

This commit is contained in:
学习很差啦
2023-04-11 18:41:34 +08:00
parent c070ed01f7
commit 2bdb8682e1
38 changed files with 70 additions and 58 deletions

View File

@@ -11,7 +11,7 @@ import api from "@/config/api.js";
import uuid from "@/utils/uuid.modified.js";
import jwt from '@/js_sdk/t-jwt/jwt.js'
import store from "../store";
let isNavigateTo = false
@@ -131,7 +131,7 @@ http.interceptors.response.use(
// cleanStorage();
// isRefreshing = false;
// }
uni.showLoading() ? uni.hideLoading() : ''
let token = storage.getAccessToken();
if (
(token && response.statusCode === 403) ||
@@ -196,6 +196,15 @@ http.interceptors.response.use(
title: response.data.message,
icon: "none",
duration: 1500,
success: function () {
store.state.isShowToast = true;
},
fail: function () {
store.state.isShowToast = false;
},
complete: function () {
store.state.isShowToast = false;
}
});
}
}