From bda764a7ff8aafc380585c9b09abce4f20689f6c Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 23 Aug 2023 15:19:09 +0800 Subject: [PATCH] chore: eslint --- .eslintrc.js | 1 + src/utils/http/axios/index.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index bb13e17e..7705020d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,6 +12,7 @@ module.exports = { '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-misused-promises': 'off', 'prefer-promise-reject-errors': 'off', 'no-case-declarations': 'off', 'no-console': 'off', diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 42ce83c8..4806d794 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -175,11 +175,12 @@ const transform: AxiosTransform = { requestInterceptors: (config, options) => { // 是否需要设置 token let isToken = (config as Recordable)?.requestOptions?.withToken === false - whiteList.some((v) => { + isToken = whiteList.some((v) => { if (config.url) { config.url.includes(v) - return (isToken = false) + return false } + return true }) // 请求之前处理config const token = getAccessToken()