fetch(`url`, {
method: 'POST',
body: JSON.stringify({
id: this.id
}),
headers: new Headers({
'Authorization': "localStorage.getItem("access_token"),
'Content-Type': 'application/json'
}),
})
.then(res => res.blob())
.then(data => {
const blobUrl = window.URL.createObjectURL(data);
const a = document.createElement('a');
a.download = regFileNames+'.txt';
a.href = blobUrl;
a.click();
});
网友评论