wujingjing
2024-09-09 e8be9acee7c787349745677eb9e2a7feb2d34d67
src/utils/request.ts
@@ -37,11 +37,12 @@
   clearAccessTokens();
   window.location.reload();
});
window.handleNoAuth = handleNoAuth;
let requestNum = 0;
let loadingInstance: ReturnType<typeof ElLoadingService>;
const addLoading = () => {
   // 增加loading 如果pending请求数量等于1,弹出loading, 防止重复弹出
   // 增加loading 如果pending请求数量等于1,弹出loading, 防止重复弹出F
   requestNum++;
   if (requestNum == 1) {
      loadingInstance = ElLoadingService({
@@ -61,7 +62,6 @@
   // 添加请求拦截器
   request.interceptors.request.use(
      (config) => {
         console.log('🚀 ~ config:', config);
         // 获取本地的 token
         const accessSession = Local.get(accessSessionKey);
         const { loading = true, noAuth = false, handleFail = true } = config as ExtraConfig;