第一种方法,转blob对象
this.$axios({
url: `/md2api/attachment/c/${
val.code}`,
method: "GET",
responseType: 'blob', //设置响应格式
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
})
.then(function (response) {
let b = new Blob([response.data]); //拿到文件流下载对象
let url = window.URL.createObjectURL(b)