const fileSetNameDown = (res,name) =>{
let link = document.createElement("a");
let fileName = decodeURIComponent(
res.headers["content-disposition"].split("=")[1]
);
let ext = fileName.substring(fileName.lastIndexOf('.'));
// 新建一个blob对象保证重命名文件成功
var url = URL.createObjectURL(
new Blob([res.data], {
type: "application/x-download;charset=UTF-8",
})
);
name ? link.download = name + ext : link.download = fileName + ext;
link.href = url;
link.click();
return true;
}