refactor: 更新存储菜单组件的弹出位置为顶部右侧,优化HTTP服务实例创建方式以增强类型安全
This commit is contained in:
parent
6163b0baa5
commit
6c7fcb9eba
@ -40,7 +40,7 @@
|
|||||||
v-if="showSubMenu && selectedLocation"
|
v-if="showSubMenu && selectedLocation"
|
||||||
:open="!!showSubMenu"
|
:open="!!showSubMenu"
|
||||||
:trigger="[]"
|
:trigger="[]"
|
||||||
placement="rightTop"
|
placement="topRight"
|
||||||
:get-popup-container="getSubMenuContainer"
|
:get-popup-container="getSubMenuContainer"
|
||||||
@open-change="handleSubMenuOpenChange"
|
@open-change="handleSubMenuOpenChange"
|
||||||
>
|
>
|
||||||
|
|||||||
@ -2,11 +2,11 @@ import { message } from 'ant-design-vue';
|
|||||||
import axios, { type AxiosInstance, type AxiosRequestConfig } from 'axios';
|
import axios, { type AxiosInstance, type AxiosRequestConfig } from 'axios';
|
||||||
|
|
||||||
// 创建HTTP实例
|
// 创建HTTP实例
|
||||||
const http: HttpInstance = axios.create({
|
const http = (axios.create({
|
||||||
baseURL: import.meta.env.ENV_HTTP_BASE,
|
baseURL: import.meta.env.ENV_HTTP_BASE,
|
||||||
adapter: 'fetch',
|
adapter: 'fetch',
|
||||||
timeout: 30_000,
|
timeout: 30_000,
|
||||||
});
|
}) as unknown) as HttpInstance;
|
||||||
|
|
||||||
// 添加FormData上传方法
|
// 添加FormData上传方法
|
||||||
http.postFormData = async <D = void>(url: string, formData: FormData, config?: AxiosRequestConfig): Promise<D | undefined> => {
|
http.postFormData = async <D = void>(url: string, formData: FormData, config?: AxiosRequestConfig): Promise<D | undefined> => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user