change download file name
This commit is contained in:
@ -127,13 +127,14 @@ function Index() {
|
||||
// //document.body.appendChild(link);
|
||||
// link.click();
|
||||
|
||||
console.log(response.headers)
|
||||
|
||||
const url = window.URL.createObjectURL(new Blob([response.data], { type: 'application/vnd.ms-excel' }));
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.target = '_blank'
|
||||
link.click();
|
||||
const filename = response.headers
|
||||
.get("content-disposition")
|
||||
.split('"')[1];
|
||||
const text = response.text();
|
||||
console.log(filename)
|
||||
console.log(text)
|
||||
//return { filename, text };
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user