1.ios不支持window.open(),要创建a链接

let elink = document.createElement('a');
elink.href = baseURL+'/onlineContract/downloadPdf2'+'?custId='+this.$route.query.custId +'&orderId='+localStorage.getItem('orderId')+'&orderType='+localStorage.getItem('orderType');
elink.target = "_parent";
document.body.appendChild(elink);
elink.click();
document.body.removeChild(elink);
 
2.后台返回图片流形式
Axios.post( //图片流
'/onlineContract/getGraphicCode',
params,
{
responseType:'blob',
emulateJSON:true
}
).then(res =>{
console.log(res)
this.picSrc = window.URL.createObjectURL(res.data)
})
 
 2.后台返回pdf流形式
Axios.get(  //pdf流
'/onlineContract/downloadPdf2'+'?custId='+this.$route.query.custId +'&orderId='+localStorage.getItem('orderId')+'&orderType='+localStorage.getItem('orderType'),
queryString.stringify(params),
{
responseType:'blob',
emulateJSON:true
}
).then(res =>{
const _res = res.data;
let blob = new Blob([_res], {type: 'application/pdf'});
this.pdfUrl = window.URL.createObjectURL(blob); //创建下载的链接
})

最新文章

  1. Git 安装
  2. Direct3D11学习:(五)演示程序框架
  3. HDU 1513 Palindrome(最长公共子序列)
  4. Android 退出app,后台推送的服务也停止了,怎么可以做到不停止后台服务呢?
  5. [Ramda] Basic Curry with Ramda
  6. 自制单片机之二-----AT89S51ISP下载线的制做
  7. 简单计算器(Android)
  8. window.open实现模式窗口(只弹出一个window.open)
  9. 微信小程序之----video视频播放
  10. EBS应付(AP)模块常用表
  11. Ubuntu14.04和16.04官方默认更新源sources.list和第三方源推荐(干货!)
  12. Linux top 命令详解
  13. Jessica's Reading Problem POJ - 3320(尺取法2)
  14. PYTHON-基本数据类型-元祖类型,字典类型,集合类型-练习
  15. 微信小程序之 ----API接口
  16. POJ3111 K Best 2017-05-11 18:12 31人阅读 评论(0) 收藏
  17. jQuery学习笔记(jquery.ui插件)
  18. A+B for Input-Output Practice (VIII)
  19. 关于Eclipse连接sql server 2008的若干问题
  20. OAF_OAF增删改-新增的实现(案例)

热门文章

  1. vscode1.50配置python虚拟环境
  2. KingbaseES V8R3集群运维案例之---kingbase_monitor.sh启动”two master“案例
  3. springboot启动类剔除扫描某个包
  4. vue webpack打包之后 重新修改配置文件接口API路径,无需修改代码后再打包
  5. MyBatisPlus 报MP_OPTLOCK_VERSION_ORIGINAL not found. Available parameters are错误
  6. EMQX 在 Kubernetes 中如何进行优雅升级
  7. java使用MVC编程模型实现1+到100图形界面
  8. SQL中各种join的区别
  9. Scrapy之Request函数回调未执行 Filtered offsite request to 'XXX'
  10. C++内存分配Arena,指的是提前分配的一大块连续内存空间