Loading

前端预览pdf文件流

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'
  })
}
posted @ 2022-09-22 14:16  资深if-else侠  阅读(1409)  评论(1)    收藏  举报