无木
2021-06-30 d509e897be5753c852e912112e70dac6247ba467
fix(axios): option `withToken` not work
1个文件已修改
2 ■■■ 已修改文件
src/utils/http/axios/index.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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}`