zoukankan      html  css  js  c++  java
  • [原创]某页网付费简历模板下载方法

    方法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=" 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();

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

  • 相关阅读:
    STM32学习笔记1(ADC多通道采样)
    SQL Server索引管理之六大铁律
    如何激励员工?
    第一周学习计划
    山寨STL实现之traits,construct&destruct
    山寨STL实现之内存池
    山寨STL实现之vector
    山寨STL实现之allocator
    Python 开发环境搭建
    Java | Python 流程控制对比
  • 原文地址:https://www.cnblogs.com/yueyue184/p/9539181.html
Copyright © 2011-2022 走看看