0
点赞
收藏
分享

微信扫一扫

vue通过iframe方式嵌套grafana图表

1 报错内容

Mixed Content: The page at ‘https://xxx’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘http://xxx’. This request has been blocked; the content must be served over HTTPS.
在这里插入图片描述

2 报错原因

页面通过 HTTPS 加载,但是尝试通过 XMLHttpRequest 请求一个 HTTP 资源。现代浏览器为了安全考虑,默认会阻止这种不安全的请求,报混合错误,这篇文章给出前端的解决方式。

3 解决方式

我这个报错是vue项目中出现的,找到这个项目的index.html文件,在headl里加上以下内容,然后生产环境就能正常访问了:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

在这里插入图片描述

举报

相关推荐

0 条评论