fix(axios): option `withToken` not work
This commit is contained in:
parent
424b171e0d
commit
d509e897be
|
|
@ -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}`
|
||||
|
|
|
|||
Loading…
Reference in New Issue