feat: 文件下载页面增加 loading

This commit is contained in:
zhengkunwang223 2023-03-14 23:04:53 +08:00 committed by zhengkunwang223
parent 0fe1fd3c7b
commit fb5c3429e5
2 changed files with 2 additions and 1 deletions

View file

@ -76,7 +76,7 @@ export const MoveFile = (params: File.FileMove) => {
};
export const DownloadFile = (params: File.FileDownload) => {
return http.download<BlobPart>('files/download', params, { responseType: 'blob' });
return http.download<BlobPart>('files/download', params, { responseType: 'blob', timeout: 20000 });
};
export const ComputeDirSize = (params: File.DirSizeReq) => {

View file

@ -454,6 +454,7 @@ const openDownload = () => {
fileDownload.name = selects.value.length > 1 ? getRandomStr(6) : selects.value[0].name;
downloadRef.value.acceptParams(fileDownload);
} else {
loading.value = true;
fileDownload.name = selects.value[0].name;
DownloadFile(fileDownload as File.FileDownload)
.then((res) => {