const req = new XMLHttpRequest()
req.open('GET','/xxx/xxx', true)
req.responseType = 'blob'
req.setRequestHeader('Content-Type', 'application/json')
req.onload = function () {
const data = req.response
const blob = new Blob([data])
const blobUrl = window.URL.createObjectURL(blob)
const a = document.createElement('a')
a.style.display = 'none'
a.download = 'aaa.pdf'
a.href = blobUrl
a.click()
}
req.send()
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。