From ce19454b5e4b53863d2b145e1e26eb0aecc74b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=8C=E7=B3=96=E5=8C=85=E5=AD=90?= Date: Mon, 6 Feb 2023 10:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=8C=E6=9B=B2=E5=BA=93=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/api/Music.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/api/Music.vue b/src/views/api/Music.vue index e2db1c0..a8445b2 100644 --- a/src/views/api/Music.vue +++ b/src/views/api/Music.vue @@ -71,6 +71,7 @@ @@ -241,6 +242,13 @@ export default class Music extends BaseList { this.currentRow = { ...row } row.isEditing = true } + download(row: MusicModel) { + const link = document.createElement('a') + link.setAttribute('href', `/api/v2/common/music/load/${row._id}`) + link.setAttribute('download', row.name) + link.setAttribute('target', '_blank') + link.click() + } remove(row: MusicModel) { ElMessageBox.confirm(`是否确认删除 ${row.name} ?`, '确认删除', {type: 'warning'}).then(async () => { const data = await this.$http.delete<{params: {id: string}}, any>('/api/v2/music/delete', {params: {id: row._id}})