Commit d509e897be5753c852e912112e70dac6247ba467
1 parent
424b171e
fix(axios): option `withToken` not work
Showing
1 changed file
with
1 additions
and
1 deletions
src/utils/http/axios/index.ts
... | ... | @@ -122,7 +122,7 @@ const transform: AxiosTransform = { |
122 | 122 | requestInterceptors: (config, options) => { |
123 | 123 | // 请求之前处理config |
124 | 124 | const token = getToken(); |
125 | - if (token && options?.requestOptions?.withToken !== false) { | |
125 | + if (token && (config as Recordable)?.requestOptions?.withToken !== false) { | |
126 | 126 | // jwt token |
127 | 127 | config.headers.Authorization = options.authenticationScheme |
128 | 128 | ? `${options.authenticationScheme} ${token}` | ... | ... |