|
@@ -1375,13 +1375,21 @@ const doDownloadZip = async ()=>{
|
|
|
const res: Blob = await axios.get(url, {
|
|
|
responseType: 'blob',
|
|
|
});
|
|
|
- _zip.file(item.path.split('?')[0], res, { createFolders: true });
|
|
|
+ let path = item.path.split('?')[0];
|
|
|
+ if(path.startsWith('/')){
|
|
|
+ path = path.slice(1);
|
|
|
+ }
|
|
|
+ _zip.file(path, res, { createFolders: true });
|
|
|
}catch(e){
|
|
|
console.log(e);
|
|
|
}
|
|
|
} else if (item.data) {
|
|
|
//直接写数据
|
|
|
- _zip.file(item.path, item.data, { createFolders: true });
|
|
|
+ let path = item.path;
|
|
|
+ if(path.startsWith('/')){
|
|
|
+ path = path.slice(1);
|
|
|
+ }
|
|
|
+ _zip.file(path, item.data, { createFolders: true });
|
|
|
}
|
|
|
})
|
|
|
);
|
|
@@ -2109,13 +2117,21 @@ const saveDownload = async () => {
|
|
|
const res: Blob = await axios.get(item.url.startsWith('/')?(cdn+item.url):item.url, {
|
|
|
responseType: 'blob',
|
|
|
});
|
|
|
- zip.file(item.path.split('?')[0], res, { createFolders: true });
|
|
|
+ let path = item.path.split('?')[0];
|
|
|
+ if(path.startsWith('/')){
|
|
|
+ path = path.slice(1);
|
|
|
+ }
|
|
|
+ zip.file(path, res, { createFolders: true });
|
|
|
}catch(e){
|
|
|
console.log(e);
|
|
|
}
|
|
|
} else if (item.data) {
|
|
|
//直接写数据
|
|
|
- zip.file(item.path, item.data, { createFolders: true });
|
|
|
+ let path = item.path;
|
|
|
+ if(path.startsWith('/')){
|
|
|
+ path = path.slice(1);
|
|
|
+ }
|
|
|
+ zip.file(path, item.data, { createFolders: true });
|
|
|
}
|
|
|
})
|
|
|
);
|