|
@@ -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',
|