Browse Source

骄阳音乐修改

朱鑫波 4 years ago
parent
commit
8937631712
1 changed files with 21 additions and 21 deletions
  1. 21 21
      src/components/music-list/music-list.vue

+ 21 - 21
src/components/music-list/music-list.vue

@@ -169,27 +169,27 @@ export default {
     deleteItem(item, index) {
     deleteItem(item, index) {
       // this.$emit('del', index) // 触发删除事件
       // this.$emit('del', index) // 触发删除事件
       // console.log(item, index)
       // console.log(item, index)
-      // let downloadElement = document.createElement('a')
-      // downloadElement.href = musicUrl + '?id=' + item.id + '.mp3'
-      // downloadElement.download = item.name
-      // downloadElement.target = '_blank'
-      // document.body.appendChild(downloadElement)
-      // downloadElement.click()
-      // document.body.removeChild(downloadElement)
-
-      downFilePost('/ctop/bytedanceMusicInfo/netEaseDownLoad', {
-        musicName: item.name,
-        musicUrl: musicUrl + '?id=' + item.id + '.mp3',
-      }).then((res) => {
-        const blob = new Blob([res], { type: 'audio/mpeg' })
-        const a = document.createElement('a')
-        const url = window.URL.createObjectURL(blob)
-        const filename = item.musicInfo.name
-        a.href = url
-        a.download = filename
-        a.click()
-        window.URL.revokeObjectURL(url)
-      })
+      let downloadElement = document.createElement('a')
+      downloadElement.href = musicUrl + '?id=' + item.id + '.mp3'
+      downloadElement.download = item.name
+      downloadElement.target = '_blank'
+      document.body.appendChild(downloadElement)
+      downloadElement.click()
+      document.body.removeChild(downloadElement)
+
+      // downFilePost('/ctop/bytedanceMusicInfo/netEaseDownLoad', {
+      //   musicName: item.name,
+      //   musicUrl: musicUrl + '?id=' + item.id + '.mp3',
+      // }).then((res) => {
+      //   const blob = new Blob([res], { type: 'audio/mpeg' })
+      //   const a = document.createElement('a')
+      //   const url = window.URL.createObjectURL(blob)
+      //   const filename = item.musicInfo.name
+      //   a.href = url
+      //   a.download = filename
+      //   a.click()
+      //   window.URL.revokeObjectURL(url)
+      // })
     },
     },
     ...mapMutations({
     ...mapMutations({
       setPlaying: 'SET_PLAYING',
       setPlaying: 'SET_PLAYING',