[原创]某页网付费简历模板下载方法

方法1.通过断点js 获取到下载的url

点击下载按钮会触发这个事件.

 1 rightListBtnFn: function(t) {
 2                     var e = this;
 3                     zhuge.track("cv_click_template_download", {
 4                         tid: this.templateID,
 5                         is_unlock: 1 == this.templateData.resume_info.is_lock ? 0 : 1,
 6                         language: "1" == this.templateData.resume_info.i18n_id ? 1 : 2,
 7                         type_id: t
 8                     }),
 9                     this.templateData.resume_info.is_lock ? this.unlockFn() : 1 == t ? (this.showEmail = !0,
10                     this.emailValue = this.templateData.resume_info.email) : this.is_download || (this.is_download = !0,
11                     this.$http.get(l.logTemplateDown, {
12                         params: {
13                             resume_id: this.templateData.resume_info.id
14                         }
15                     }).then(function(t) {
16                         e.is_download = !1,
17                         1 == t.status ? (window.location.href = t.data.pdf_file_url,
18                         e.showDownload = !0) : alert(t.msg)
19                     }))
20                 }
1 //这个就是下载url 
2  this.templateData.resume_info.pdf_file_url

 

 

方法2:

使用控制台 

1 //查看html 找到canvas id, 有几页就又几个
2 <canvas id="page1" width="794" height="1123" style="width: 794px; height: 1123px;"></canvas>
1 var oCanvas=document.getElementById("page1");var strDataURI = oCanvas.toDataURL();console.log(strDataURI); var a=document.createElement("a");a.href=strDataURI;a.download="page1";a.click();

 

以上代码都是原理,可以进一步优化.实现全自动.

 

转载于:https://www.cnblogs.com/yueyue184/p/9539181.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值