主要是接口请求下载文件的时候
const xhr = new XMLHttpRequest()
xhr.open('get','http://www.baidu.com')
xhr.send()
xhr.onload = function(){
const blob = new Blob([xhr.response],{
type:'text/html'})
const a = document.createElement('a')
主要是接口请求下载文件的时候
const xhr = new XMLHttpRequest()
xhr.open('get','http://www.baidu.com')
xhr.send()
xhr.onload = function(){
const blob = new Blob([xhr.response],{
type:'text/html'})
const a = document.createElement('a')