From 5baa141b89a6466c9c1d0b7f723e4b55c6675b8b Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Thu, 20 Mar 2025 10:12:15 +0800 Subject: [PATCH] fix: type-check (#2629) --- ui/src/request/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/request/index.ts b/ui/src/request/index.ts index d57928219..72588d2c6 100644 --- a/ui/src/request/index.ts +++ b/ui/src/request/index.ts @@ -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()