fix: 修改 axios 类型错误

This commit is contained in:
奔跑的面条 2023-06-27 17:54:17 +08:00
parent adf7004727
commit 952e61bbba

View File

@ -1,4 +1,4 @@
import axios, { AxiosResponse, AxiosRequestConfig } from 'axios'
import axios, { AxiosResponse, InternalAxiosRequestConfig, AxiosError } from 'axios'
import { ResultEnum } from "@/enums/httpEnum"
import { ErrorPageNameMap } from "@/enums/pageEnum"
import { redirectErrorPage } from '@/utils'
@ -9,10 +9,10 @@ const axiosInstance = axios.create({
})
axiosInstance.interceptors.request.use(
(config: AxiosRequestConfig) => {
(config: InternalAxiosRequestConfig) => {
return config
},
(error: AxiosRequestConfig) => {
(error: AxiosError) => {
Promise.reject(error)
}
)