The file at 'http://xxxx.xlsx' was loaded over an insecure connection?

vue 项目想下载文件,文件放在public目录下,通过这种方式下载

        <a href="/xxx.xlsx" download="xxx.xlsx">下载文件</a>

提示错误

The file at 'http://xxxx.xlsx' was loaded over an insecure connection. This file should be served over HTTPS  

我当前项目是本地启动的http环境,下载文件也在本地,现在怎么修改呢?
The file at 'http://xxxx.xlsx' was loaded over an insecure connection?


回答:

使用双斜杠<a href="//xxx.xlsx" download="xxx.xlsx">下载文件</a>,其次你的网站如果是https,就必须要提供https的资源。如果你是https网站,用http资源,就会出现你的提示日志。

以上是 The file at &#x27;http://xxxx.xlsx&#x27; was loaded over an insecure connection? 的全部内容, 来源链接: utcz.com/p/935051.html

回到顶部