Browse Source

chore: eslint

main
xingyu 2 years ago
parent
commit
bda764a7ff
  1. 1
      .eslintrc.js
  2. 5
      src/utils/http/axios/index.ts

1
.eslintrc.js

@ -12,6 +12,7 @@ module.exports = {
'@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off', '@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'prefer-promise-reject-errors': 'off', 'prefer-promise-reject-errors': 'off',
'no-case-declarations': 'off', 'no-case-declarations': 'off',
'no-console': 'off', 'no-console': 'off',

5
src/utils/http/axios/index.ts

@ -175,11 +175,12 @@ const transform: AxiosTransform = {
requestInterceptors: (config, options) => { requestInterceptors: (config, options) => {
// 是否需要设置 token // 是否需要设置 token
let isToken = (config as Recordable)?.requestOptions?.withToken === false let isToken = (config as Recordable)?.requestOptions?.withToken === false
whiteList.some((v) => { isToken = whiteList.some((v) => {
if (config.url) { if (config.url) {
config.url.includes(v) config.url.includes(v)
return (isToken = false) return false
} }
return true
}) })
// 请求之前处理config // 请求之前处理config
const token = getAccessToken() const token = getAccessToken()