wujingjing
2024-09-09 e8be9acee7c787349745677eb9e2a7feb2d34d67
src/utils/request.ts
@@ -37,14 +37,15 @@
   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({
      loadingInstance = ElLoadingService({
         text: '加载中...',
         target: '.layout-parent',
      });
@@ -72,7 +73,7 @@
            config.headers['hswatersession'] = accessSession;
         }
         if (!noAuth) {
            if (!accessSession ) {
            if (!accessSession) {
               handleNoAuth();
            }
         }
@@ -111,7 +112,7 @@
            switch (serveData?.err_code) {
               case ErrorCode.Auth:
                  handleNoAuth();
                     throw '权限验证失败';
                  throw '权限验证失败';
                  break;
               case ErrorCode.Exception:
                  ElMessage.error('内部错误!');