From 2266ca2cf1fc88d2b0e9358eef0a700372a74048 Mon Sep 17 00:00:00 2001 From: MengYX Date: Sat, 23 Nov 2019 18:56:45 +0800 Subject: [PATCH] Fix Download Button --- src/App.vue | 32 +++++++++++++------------------- src/plugins/mflac.js | 2 -- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/App.vue b/src/App.vue index 7cc61a9..1774858 100644 --- a/src/App.vue +++ b/src/App.vue @@ -51,14 +51,9 @@ - - - - - + - @@ -164,16 +159,13 @@ } else { this.$notify.error({ title: '出现问题', - message: data.message + ',参考使用提示', + message: data.message + "," + file.name + + ',参考使用提示', dangerouslyUseHTMLString: true }); window._paq.push(["trackEvent", "Unlock", "Error", file.name]); } - - })(); - - }, handlePlay(index, row) { this.playing_url = row.file; @@ -185,6 +177,14 @@ URL.revokeObjectURL(row.picture); this.tableData.splice(index, 1); }, + handleDownload(row) { + let a = document.createElement('a'); + a.href = row.file; + a.download = row.filename; + document.body.append(a); + a.click(); + a.remove(); + }, handleDeleteAll() { this.tableData.forEach(value => { URL.revokeObjectURL(value.file); @@ -196,17 +196,11 @@ let index = 0; let c = setInterval(() => { if (index < this.tableData.length) { - let a = document.createElement('a'); - a.href = this.tableData[index].file; - a.download = this.tableData[index].filename; - document.body.append(a); - a.click(); - a.remove(); + this.handleDownload(this.tableData[index]); index++; } else { clearInterval(c); } - }, 1000); } diff --git a/src/plugins/mflac.js b/src/plugins/mflac.js index fdc48e1..d259f0b 100644 --- a/src/plugins/mflac.js +++ b/src/plugins/mflac.js @@ -31,7 +31,6 @@ async function Decrypt(file) { // 导出 const musicData = new Blob([audioData], {type: "audio/flac"}); const musicUrl = URL.createObjectURL(musicData); - console.log(musicUrl); // 读取Meta let tag = await musicMetadata.parseBlob(musicData); @@ -104,7 +103,6 @@ class Mask { } if (!flag) continue; this.mask = mask; - console.log(mask); return true; } return false;