download = (id,filename) => {

fetch(`http://127.0.0.1:8111/v1/downloadtask/${id}`, {

method: "GET",

headers: {

"Content-Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"

},

responseType: "blob"

}).then((response) => {

response.blob().then(blob => {

const blobUrl = window.URL.createObjectURL(blob);

const a = document.createElement('a');

a.href = blobUrl;

a.download = `${filename}.xlsx` ;

a.click();

window.URL.revokeObjectURL(blobUrl);

});

}).catch((error) => {

console.log(error);

});

};