From d509e897be5753c852e912112e70dac6247ba467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=9C=A8?= Date: Wed, 30 Jun 2021 01:07:27 +0800 Subject: [PATCH] fix(axios): option `withToken` not work --- src/utils/http/axios/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index dd2587e29..f20418504 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -122,7 +122,7 @@ const transform: AxiosTransform = { 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}`