vue 项目下载excel 文件报错The file at 'blob:http://xxxx' was loaded over an insecure connection?

The file at 'blob:http://xxxx' was loaded over an insecure connection. This file should be served over HTTPS. 这种要怎么改?

          <div @click="download">下载</div>

download() {

const x: any = new window.XMLHttpRequest();

x.open(

"GET",

"https:xxxx.xlsx",

true

);

x.responseType = "blob";

x.onload = () => {

const url = window.URL.createObjectURL(x.response);

const link = document.createElement("a");

link.href = url;

link.download = "格式文件.xlsx";

link.click();

};

x.send();

}

以上是 vue 项目下载excel 文件报错The file at &#x27;blob:http://xxxx&#x27; was loaded over an insecure connection? 的全部内容, 来源链接: utcz.com/p/935069.html

回到顶部