Skip to content

Commit 5d54e05

Browse files
committed
fix(axios): 🐛 Fixed axios v1.3.4 types broken
1 parent d6a1cce commit 5d54e05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AxiosError, AxiosRequestConfig } from 'axios'
1+
import type { AxiosError, InternalAxiosRequestConfig } from 'axios'
22
import axios from 'axios'
33
import { showNotify } from 'vant'
44
import { localStorage } from '@/utils/local-storage'
@@ -48,7 +48,7 @@ const errorHandler = (error: RequestError): Promise<any> => {
4848
}
4949

5050
// 请求拦截器
51-
const requestHandler = (config: AxiosRequestConfig): AxiosRequestConfig | Promise<AxiosRequestConfig> => {
51+
const requestHandler = (config: InternalAxiosRequestConfig): InternalAxiosRequestConfig | Promise<InternalAxiosRequestConfig> => {
5252
const savedToken = localStorage.get(STORAGE_TOKEN_KEY)
5353
// 如果 token 存在
5454
// 让每个请求携带自定义 token, 请根据实际情况修改

0 commit comments

Comments
 (0)