| @@ -1859,24 +1859,27 @@ export default { | |||||
| .then((res) => { | .then((res) => { | ||||
| console.log(res, 'adasdjslakd') | console.log(res, 'adasdjslakd') | ||||
| let blob = new Blob([res], { type: "audio/*" }); | let blob = new Blob([res], { type: "audio/*" }); | ||||
| let date = new Date(); | |||||
| let time = date.toLocaleDateString(); | |||||
| saveAs(blob, "audio.mp3"); | |||||
| const a = document.createElement('a'); | |||||
| document.body.appendChild(a) | |||||
| a.style.display = 'none' | |||||
| // 使用获取到的blob对象创建的url | |||||
| const url = window.URL.createObjectURL(res); | |||||
| a.href = url; | |||||
| // 指定下载的文件名,就‘’写默认的下载名字。不指定他就根据上传名直接下载了宝。 | |||||
| a.download = ''; | |||||
| a.click(); | |||||
| document.body.removeChild(a) | |||||
| // 移除blob对象的url | |||||
| window.URL.revokeObjectURL(url); | |||||
| // let date = new Date(); | |||||
| // let time = date.toLocaleDateString(); | |||||
| // const a = document.createElement('a'); | |||||
| // document.body.appendChild(a) | |||||
| // a.style.display = 'none' | |||||
| // // 使用获取到的blob对象创建的url | |||||
| // const url = window.URL.createObjectURL(res); | |||||
| // a.href = url; | |||||
| // // 指定下载的文件名,就‘’写默认的下载名字。不指定他就根据上传名直接下载了宝。 | |||||
| // a.download = ''; | |||||
| // a.click(); | |||||
| // document.body.removeChild(a) | |||||
| // // 移除blob对象的url | |||||
| // window.URL.revokeObjectURL(url); | |||||
| }) | }) | ||||
| .catch((error) => { | .catch((error) => { | ||||
| console.log(error); | console.log(error); | ||||
| this.$message.error('请求超时') | |||||
| }); | }); | ||||
| }, | }, | ||||
| }, | }, | ||||