const downloadFile = (file, url) => {
let fileName = parseTime(new Date());
let fileType = getFileType(file);
let a = document.createElement('a');
a.href = url + '?response-content-type=application/octet-stream';
a.download = `${fileName}${fileType}`;
console.log('a.href', url);
console.log('a.download', a.download);
a.click();
};
标签:log,url,href,let,file,download,下载,图片
From: https://www.cnblogs.com/Sultan-ST/p/16866354.html