fix: type-check (#2629)

This commit is contained in:
shaohuzhang1 2025-03-20 10:12:15 +08:00 committed by GitHub
parent ea0ab5e3d2
commit 5baa141b89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
import axios, { type AxiosRequestConfig } from 'axios'
import axios, { type InternalAxiosRequestConfig, AxiosHeaders } from 'axios'
import { MsgError } from '@/utils/message'
import type { NProgress } from 'nprogress'
import type { Ref } from 'vue'
@ -19,9 +19,9 @@ const instance = axios.create(axiosConfig)
/* 设置请求拦截器 */
instance.interceptors.request.use(
(config: AxiosRequestConfig) => {
(config: InternalAxiosRequestConfig) => {
if (config.headers === undefined) {
config.headers = {}
config.headers = new AxiosHeaders()
}
const { user } = useStore()
const token = user.getToken()