mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-10 23:47:39 +08:00
feat: 文件下载页面增加 loading
This commit is contained in:
parent
0fe1fd3c7b
commit
fb5c3429e5
2 changed files with 2 additions and 1 deletions
|
@ -76,7 +76,7 @@ export const MoveFile = (params: File.FileMove) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DownloadFile = (params: File.FileDownload) => {
|
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) => {
|
export const ComputeDirSize = (params: File.DirSizeReq) => {
|
||||||
|
|
|
@ -454,6 +454,7 @@ const openDownload = () => {
|
||||||
fileDownload.name = selects.value.length > 1 ? getRandomStr(6) : selects.value[0].name;
|
fileDownload.name = selects.value.length > 1 ? getRandomStr(6) : selects.value[0].name;
|
||||||
downloadRef.value.acceptParams(fileDownload);
|
downloadRef.value.acceptParams(fileDownload);
|
||||||
} else {
|
} else {
|
||||||
|
loading.value = true;
|
||||||
fileDownload.name = selects.value[0].name;
|
fileDownload.name = selects.value[0].name;
|
||||||
DownloadFile(fileDownload as File.FileDownload)
|
DownloadFile(fileDownload as File.FileDownload)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue