async downloadFile() {
const cname = thisloginUserusername
const params = await thisgetParams()//自己写的获取参数方法
axios({
url: ${baseURL}/download ,
method: 'post',
data: params,
responseType: 'blob',
headers: {
cid: thiscustomerCode
}
})then(res => {
const fileName = wifi预警_${cname}csv
var blob = resdata
if ('msSaveOrOpenBlob' in navigator) {
windownavigatormsSaveOrOpenBlob(blob, fileName) //IE导出
} else {
let url = windowURLcreateObjectURL(new Blob([blob]))
let link = documentcreateElement('a')
linkstyledisplay = 'none'
linkhref = url
linksetAttribute('download', fileName)
linkclick()
}
})
},
以上就是关于vue跨域解决方法全部的内容,包括:vue跨域解决方法、vue中给的默认值是调接口取到的、32.Webpack-Proxy等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)