|
1 | | -import type { AxiosError, AxiosRequestConfig } from 'axios' |
| 1 | +import type { AxiosError, InternalAxiosRequestConfig } from 'axios' |
2 | 2 | import axios from 'axios'
|
3 | 3 | import { showNotify } from 'vant'
|
4 | 4 | import { localStorage } from '@/utils/local-storage'
|
@@ -48,7 +48,7 @@ const errorHandler = (error: RequestError): Promise<any> => {
|
48 | 48 | }
|
49 | 49 |
|
50 | 50 | // 请求拦截器
|
51 | | -const requestHandler = (config: AxiosRequestConfig): AxiosRequestConfig | Promise<AxiosRequestConfig> => { |
| 51 | +const requestHandler = (config: InternalAxiosRequestConfig): InternalAxiosRequestConfig | Promise<InternalAxiosRequestConfig> => { |
52 | 52 | const savedToken = localStorage.get(STORAGE_TOKEN_KEY)
|
53 | 53 | // 如果 token 存在
|
54 | 54 | // 让每个请求携带自定义 token, 请根据实际情况修改
|
|
0 commit comments