Skip to content

Commit

Permalink
fix(axios): option withToken not work
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetfan committed Jun 29, 2021
1 parent 424b171 commit d509e89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/http/axios/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand Down

0 comments on commit d509e89

Please sign in to comment.