• vuede axios文件下载


    this.loading = true;
    this.$http({
    baseURL: CLOUD_BASE_SERVER_URL,
              url: '/audit/auditRun/exportWord',
              method: 'get',
              responseType: 'blob',
              params: {
    id: this.runId,
    sumScoreRate: this.sumScoreRate
              }
            }).then(response => {
              this.loading = false
              var data = response.data;
      
              if (!data) {
                return
              }
      
              let url = window.URL.createObjectURL(new Blob([data]))
              let link = document.createElement('a');
              link.style.display = 'none';
              link.href = url;
              //设置新下载的文件名
              var downLoadFileName = '危险源登记.docx';
              link.setAttribute('download', downLoadFileName);
      
              document.body.appendChild(link);
              link.click();
            }).catch((error) => {
              console.log(error);
            });
  • 相关阅读:
    MD5 SHA1 CRC32
    tf 常用函数 28原则
    matplotlib 28原则
    markdown 基本语法
    tf 数据读取
    django 自定义身份认证
    代理部署
    社区发现算法问题&&NetworkX&&Gephi
    机器学习中的数学——拉格朗日乘子法
    过拟合(Overfitting)和正规化(Regularization)
  • 原文地址:https://www.cnblogs.com/zengdingxin/p/11268448.html
Copyright © 2020-2023  润新知