源码:
const url = URL.createObjectURL(new Blob([certString], {type : 'application/pdf;charset=UTF-8'}));
const fileName = '下载证书';
const elink = document.createElement('a');
elink.style.display = 'none';
elink.href = url;
elink.setAttribute('download', fileName);
// elink.download = fileName;
document.body.appendChild(elink);
elink.click();
document.body.removeChild(elink);
URL.revokeObjectURL(url);