From d509e897be5753c852e912112e70dac6247ba467 Mon Sep 17 00:00:00 2001
From: 无木 <netfan@foxmail.com>
Date: 星期三, 30 六月 2021 01:07:27 +0800
Subject: [PATCH] fix(axios): option `withToken` not work

---
 src/utils/http/axios/index.ts |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts
index dd2587e..f204185 100644
--- a/src/utils/http/axios/index.ts
+++ b/src/utils/http/axios/index.ts
@@ -122,7 +122,7 @@
   requestInterceptors: (config, options) => {
     // 璇锋眰涔嬪墠澶勭悊config
     const token = getToken();
-    if (token && options?.requestOptions?.withToken !== false) {
+    if (token && (config as Recordable)?.requestOptions?.withToken !== false) {
       // jwt token
       config.headers.Authorization = options.authenticationScheme
         ? `${options.authenticationScheme} ${token}`

--
Gitblit v1.8.0