From 79b9c73e0717c244391ab1e15c6f6da9975f2610 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 12 十一月 2024 15:58:30 +0800
Subject: [PATCH] 打包bug

---
 src/utils/request.ts |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/utils/request.ts b/src/utils/request.ts
index 650554c..79b82f4 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -47,13 +47,14 @@
     }
     // get璇锋眰鏄犲皠params鍙傛暟
     if (config.method === 'get' && config.params) {
+      console.log(config.params, '璇锋眰鍙傛暟');
       let url = config.url + '?' + tansParams(config.params);
       url = url.slice(0, -1);
       config.params = {};
       config.url = url;
     }
 
-    if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
+    if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put' || config.method === 'get')) {
       const requestObj = {
         url: config.url,
         data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
@@ -66,7 +67,7 @@
         const s_url = sessionObj.url; // 璇锋眰鍦板潃
         const s_data = sessionObj.data; // 璇锋眰鏁版嵁
         const s_time = sessionObj.time; // 璇锋眰鏃堕棿
-        const interval = 600000; // 闂撮殧鏃堕棿(ms)锛屽皬浜庢鏃堕棿瑙嗕负閲嶅鎻愪氦
+        const interval = 5; // 闂撮殧鏃堕棿(ms)锛屽皬浜庢鏃堕棿瑙嗕负閲嶅鎻愪氦
         if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
           const message = '鏁版嵁姝e湪澶勭悊锛岃鍕块噸澶嶆彁浜�';
           console.warn(`[${s_url}]: ` + message);
@@ -77,7 +78,8 @@
       }
     }
     // 褰撳紑鍚弬鏁板姞瀵�
-    if (isEncrypt && (config.method === 'post' || config.method === 'put')) {
+    if (isEncrypt && (config.method === 'post' || config.method === 'put' || config.method === 'get')) {
+      console.log('寮�鍚簡鍙傛暟鍔犲瘑');
       // 鐢熸垚涓�涓� AES 瀵嗛挜
       const aesKey = generateAesKey();
       config.headers['encrypt-key'] = encrypt(encryptBase64(aesKey));
@@ -90,7 +92,7 @@
     return config;
   },
   (error: any) => {
-    console.log(error);
+    console.log(error, 'wcs');
     return Promise.reject(error);
   }
 );
@@ -126,7 +128,7 @@
       ElNotification.error({ title: msg });
       return Promise.reject('error');
     } else {
-
+      return Promise.resolve(res.data);
     }
   },
   (error: any) => {

--
Gitblit v1.8.0