Commit 09016b4a by crushh

update: dist

parent c2abe350
......@@ -225,6 +225,7 @@ export const downloadFile = (fileName, content) => {
let blob = base64ToBlob(content); //new Blob([content]);
let evt = document.createEvent('HTMLEvents');
evt.initEvent('click', true, true); //initEvent 不加后两个参数在FF下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为
fileName = fileName.replaceAll('.', '-');
aLink.download = fileName;
aLink.href = URL.createObjectURL(blob);
// aLink.dispatchEvent(evt);
......
......@@ -161,6 +161,7 @@ export default {
const x = new XMLHttpRequest();
x.open('GET', url, true);
x.responseType = 'blob';
fileName = fileName.replaceAll('.', '-');
x.onload = function(e) {
const blob = new Blob([x.response], { type: 'image/png' });
let url = window.URL.createObjectURL(blob);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment