|
@@ -6,7 +6,7 @@ import { isFunction } from '/@/utils/is';
|
|
import { cloneDeep } from 'lodash-es';
|
|
import { cloneDeep } from 'lodash-es';
|
|
|
|
|
|
import type { RequestOptions, CreateAxiosOptions, Result } from './types';
|
|
import type { RequestOptions, CreateAxiosOptions, Result } from './types';
|
|
-import { ContentTypeEnum } from '/@/enums/httpEnum';
|
|
|
|
|
|
+// import { ContentTypeEnum } from '/@/enums/httpEnum';
|
|
import { errorResult } from './const';
|
|
import { errorResult } from './const';
|
|
|
|
|
|
export * from './axiosTransform';
|
|
export * from './axiosTransform';
|
|
@@ -107,25 +107,25 @@ export class VAxios {
|
|
this.axiosInstance.interceptors.response.use(undefined, responseInterceptorsCatch);
|
|
this.axiosInstance.interceptors.response.use(undefined, responseInterceptorsCatch);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * @description: 文件上传
|
|
|
|
- */
|
|
|
|
- uploadFiles(config: AxiosRequestConfig, params: File[]) {
|
|
|
|
- const formData = new FormData();
|
|
|
|
-
|
|
|
|
- Object.keys(params).forEach((key) => {
|
|
|
|
- formData.append(key, params[key as any]);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- return this.request({
|
|
|
|
- ...config,
|
|
|
|
- method: 'POST',
|
|
|
|
- data: formData,
|
|
|
|
- headers: {
|
|
|
|
- 'Content-type': ContentTypeEnum.FORM_DATA,
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ // /**
|
|
|
|
+ // * @description: 文件上传
|
|
|
|
+ // */
|
|
|
|
+ // uploadFiles(config: AxiosRequestConfig, params: File[]) {
|
|
|
|
+ // const formData = new FormData();
|
|
|
|
+
|
|
|
|
+ // Object.keys(params).forEach((key) => {
|
|
|
|
+ // formData.append(key, params[key as any]);
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ // return this.request({
|
|
|
|
+ // ...config,
|
|
|
|
+ // method: 'POST',
|
|
|
|
+ // data: formData,
|
|
|
|
+ // headers: {
|
|
|
|
+ // 'Content-type': ContentTypeEnum.FORM_DATA,
|
|
|
|
+ // },
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
|
|
/**
|
|
/**
|
|
* @description: 请求方法
|
|
* @description: 请求方法
|