欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Mixed Content: The page at ‘https://**.com/#/lbs/truckPoint‘ was loaded over HTTPS, but requested

程序员文章站 2022-05-30 16:30:03
...

报错:

chunk-ff6568fc.8894c5e4.js:1 Mixed Content: The page at 
'https://**.com/#/lbs/truckPoint' was loaded over HTTPS, 
but requested an insecure script 'http://api.map.baidu.com/api?
v=2.0&ak=84eSmRsdwHeRqIssbkAntHOFkAo09XIN&callback=init'.
 This request has been blocked; the content must be served over HTTPS.

原因为系统使用https,而js中有使用http的链接

http://api.map.baidu.com/api?
v=2.0&ak=84eSmRsdwHeRqIssbkAntHOFkAo09XIN&callback=init

改成

https://api.map.baidu.com/api?
v=2.0&ak=84eSmRsdwHeRqIssbkAntHOFkAo09XIN&callback=init

即可解决。

HTTPS页面里动态的引入HTTP资源,比如引入一个js文件,会被直接block掉的.在HTTPS页面里通过AJAX的方式请求HTTP资源,也会被直接block掉的。

相关标签: 错误总结