|
@@ -380,6 +380,13 @@ export default {
|
|
|
|
|
|
|
|
file_info_list.forEach((fileInfo) => {
|
|
file_info_list.forEach((fileInfo) => {
|
|
|
const { file_name, file_url, dir_name } = fileInfo;
|
|
const { file_name, file_url, dir_name } = fileInfo;
|
|
|
|
|
+ // 如果有子目录,则判断是否有,没有就创建子目录
|
|
|
|
|
+ if (dir_name.split('/').length > 1) {
|
|
|
|
|
+ if (!window.fileAPI.existsSync(`${this.tempDir}\\${dir_name}`)) {
|
|
|
|
|
+ window.fileAPI.mkdirSync(`${this.tempDir}\\${dir_name}`);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
window.fileAPI.downloadFile(file_url, `${this.tempDir}\\${dir_name}\\${file_name}`).then(() => {
|
|
window.fileAPI.downloadFile(file_url, `${this.tempDir}\\${dir_name}\\${file_name}`).then(() => {
|
|
|
this.downloadCompleted += 1;
|
|
this.downloadCompleted += 1;
|
|
|
});
|
|
});
|