|
|
@ -119,29 +119,29 @@ const QrCode = (props) => { |
|
|
|
// aa(v.qrCode)
|
|
|
|
// console.log(v.qrCode.replace('/[\r\n]/g',""));
|
|
|
|
|
|
|
|
function base64ToFile (url, name) { |
|
|
|
|
|
|
|
let mime = name.substring(name.lastIndexOf('.') + 1) |
|
|
|
let bstr = atob(url); |
|
|
|
let n = bstr.length; |
|
|
|
let u8arr = new Uint8Array(n); |
|
|
|
|
|
|
|
while (n--) { |
|
|
|
u8arr[n] = bstr.charCodeAt(n); |
|
|
|
} |
|
|
|
return new Blob([u8arr], { type: mime }); |
|
|
|
} |
|
|
|
|
|
|
|
function downloadFile(url,name='15313'){ |
|
|
|
let a=document.createElement('a'); |
|
|
|
a.setAttribute('href',url) |
|
|
|
a.setAttribute('download',name) |
|
|
|
a.setAttribute('target','_blank') |
|
|
|
let b=document.createEvent('MouseEvents') |
|
|
|
b.initEvent('click',true,true) |
|
|
|
a.dispatchEvent |
|
|
|
|
|
|
|
} |
|
|
|
// function base64ToFile (url, name) {
|
|
|
|
|
|
|
|
// let mime = name.substring(name.lastIndexOf('.') + 1)
|
|
|
|
// let bstr = atob(url);
|
|
|
|
// let n = bstr.length;
|
|
|
|
// let u8arr = new Uint8Array(n);
|
|
|
|
|
|
|
|
// while (n--) {
|
|
|
|
// u8arr[n] = bstr.charCodeAt(n);
|
|
|
|
// }
|
|
|
|
// return new Blob([u8arr], { type: mime });
|
|
|
|
// }
|
|
|
|
|
|
|
|
// function downloadFile(url,name='15313'){
|
|
|
|
// let a=document.createElement('a');
|
|
|
|
// a.setAttribute('href',url)
|
|
|
|
// a.setAttribute('download',name)
|
|
|
|
// a.setAttribute('target','_blank')
|
|
|
|
// let b=document.createEvent('MouseEvents')
|
|
|
|
// b.initEvent('click',true,true)
|
|
|
|
// a.dispatchEvent
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}}>下载二维码</Button> |
|
|
|
{/* </a> */} |
|
|
|