fix: type-check (#2629)
This commit is contained in:
parent
ea0ab5e3d2
commit
5baa141b89
@ -1,4 +1,4 @@
|
|||||||
import axios, { type AxiosRequestConfig } from 'axios'
|
import axios, { type InternalAxiosRequestConfig, AxiosHeaders } from 'axios'
|
||||||
import { MsgError } from '@/utils/message'
|
import { MsgError } from '@/utils/message'
|
||||||
import type { NProgress } from 'nprogress'
|
import type { NProgress } from 'nprogress'
|
||||||
import type { Ref } from 'vue'
|
import type { Ref } from 'vue'
|
||||||
@ -19,9 +19,9 @@ const instance = axios.create(axiosConfig)
|
|||||||
|
|
||||||
/* 设置请求拦截器 */
|
/* 设置请求拦截器 */
|
||||||
instance.interceptors.request.use(
|
instance.interceptors.request.use(
|
||||||
(config: AxiosRequestConfig) => {
|
(config: InternalAxiosRequestConfig) => {
|
||||||
if (config.headers === undefined) {
|
if (config.headers === undefined) {
|
||||||
config.headers = {}
|
config.headers = new AxiosHeaders()
|
||||||
}
|
}
|
||||||
const { user } = useStore()
|
const { user } = useStore()
|
||||||
const token = user.getToken()
|
const token = user.getToken()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user