Browse Source

RUN npm install --production --force --registry http://10.8.30.22:7000

master
wenlele 2 years ago
parent
commit
f32fa514cb
  1. 46
      web/client/src/sections/projectRegime/containers/qrCode.js

46
web/client/src/sections/projectRegime/containers/qrCode.js

@ -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> */}

Loading…
Cancel
Save