style: 上传增加进度条

This commit is contained in:
zhengkunwang223
2022-09-13 11:10:02 +08:00
committed by zhengkunwang223
parent 8a0aa168d2
commit 8e55e8e6ef
5 changed files with 41 additions and 14 deletions

View File

@@ -11,7 +11,6 @@ const globalStore = GlobalStore();
const config = {
baseURL: import.meta.env.VITE_API_URL as string,
timeout: ResultEnum.TIMEOUT as number,
// 跨域时候允许携带凭证
withCredentials: true,
};
@@ -81,6 +80,9 @@ class RequestHttp {
download<BlobPart>(url: string, params?: object, _object = {}): Promise<BlobPart> {
return this.service.post(url, params, _object);
}
upload<T>(url: string, params: object = {}, config: AxiosRequestConfig): Promise<T> {
return this.service.post(url, params, config);
}
}
export default new RequestHttp(config);