封装open pdf 新开页下载

dev_winse
杨树明 6 years ago
parent fff396a35f
commit 5d46519867

@ -345,6 +345,10 @@ export function TPMIndexHOC(WrappedComponent) {
link.dispatchEvent(evt); link.dispatchEvent(evt);
document.body.removeChild(link); document.body.removeChild(link);
} }
DownloadOpenPdf=(type,url)=>{
type===true?window.open(url):window.location.href=url;
}
render() { render() {
let{Headertop,Footerdown, isRender, AccountProfiletype}=this.state; let{Headertop,Footerdown, isRender, AccountProfiletype}=this.state;
const common = { const common = {
@ -364,6 +368,7 @@ export function TPMIndexHOC(WrappedComponent) {
checkIfProfileCompleted: this.checkIfProfileCompleted, checkIfProfileCompleted: this.checkIfProfileCompleted,
ShowOnlinePdf:(url)=>this.ShowOnlinePdf(url), ShowOnlinePdf:(url)=>this.ShowOnlinePdf(url),
DownloadFileA:(title,url)=>this.DownloadFileA(title,url), DownloadFileA:(title,url)=>this.DownloadFileA(title,url),
DownloadOpenPdf:(type,url)=>this.DownloadOpenPdf(type,url)
} }
return ( return (
<div> <div>

Loading…
Cancel
Save