吴健
2024-11-27 fb3b3e41804abeeb4a54d9df3030bc3cdb75c245
billion-ui/src/plugins/download.js
@@ -17,12 +17,12 @@
      responseType: 'blob',
      headers: { 'Authorization': 'Bearer ' + getToken() }
    }).then((res) => {
      const isBlob = blobValidate(res.data);
      const isBlob = blobValidate(res.index);
      if (isBlob) {
        const blob = new Blob([res.data])
        const blob = new Blob([res.index])
        this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
      } else {
        this.printErrMsg(res.data);
        this.printErrMsg(res.index);
      }
    })
  },
@@ -34,12 +34,12 @@
      responseType: 'blob',
      headers: { 'Authorization': 'Bearer ' + getToken() }
    }).then((res) => {
      const isBlob = blobValidate(res.data);
      const isBlob = blobValidate(res.index);
      if (isBlob) {
        const blob = new Blob([res.data])
        const blob = new Blob([res.index])
        this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
      } else {
        this.printErrMsg(res.data);
        this.printErrMsg(res.index);
      }
    })
  },
@@ -52,12 +52,12 @@
      responseType: 'blob',
      headers: { 'Authorization': 'Bearer ' + getToken() }
    }).then((res) => {
      const isBlob = blobValidate(res.data);
      const isBlob = blobValidate(res.index);
      if (isBlob) {
        const blob = new Blob([res.data], { type: 'application/zip' })
        const blob = new Blob([res.index], { type: 'application/zip' })
        this.saveAs(blob, name)
      } else {
        this.printErrMsg(res.data);
        this.printErrMsg(res.index);
      }
      downloadLoadingInstance.close();
    }).catch((r) => {