await api(html).then(res => {
const blob = new Blob([res], { type: 'application/pdf;charset-UTF-8' })
const url = URL.createObjectURL(blob)
window.open(url)
})
export function api (data) {
return request({
url: '/kc/print/kcSeatingExport',
method: 'post',
data,
responseType: 'blob'
})
}
标签:const,预览,url,res,前端,api,blob,pdf
From: https://www.cnblogs.com/whh666/p/16719083.html