From 3b18a476b709bdf4cd025889b3de4cfd5aac0ab6 Mon Sep 17 00:00:00 2001
From: LiuHao <liuhaoai545@gmail.com>
Date: 星期五, 26 一月 2024 09:59:05 +0800
Subject: [PATCH] add hooks - useDialog

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

diff --git a/src/utils/request.ts b/src/utils/request.ts
index 6135d69..3de2076 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -36,11 +36,12 @@
     // 瀵瑰簲鍥介檯鍖栬祫婧愭枃浠跺悗缂�
     config.headers['Content-Language'] = getLanguage();
 
-    const isToken = (config.headers || {}).isToken === false;
+    const isToken = config.headers?.isToken === false;
     // 鏄惁闇�瑕侀槻姝㈡暟鎹噸澶嶆彁浜�
-    const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
+    const isRepeatSubmit = config.headers?.repeatSubmit === false;
     // 鏄惁闇�瑕佸姞瀵�
-    const isEncrypt = (config.headers || {}).isEncrypt === 'true';
+    const isEncrypt = config.headers?.isEncrypt === 'true';
+
     if (getToken() && !isToken) {
       config.headers['Authorization'] = 'Bearer ' + getToken(); // 璁╂瘡涓姹傛惡甯﹁嚜瀹氫箟token 璇锋牴鎹疄闄呮儏鍐佃嚜琛屼慨鏀�
     }

--
Gitblit v1.9.3