http修改为https后。原本加载resource/static文件下的ico使用url("../../img/common/r2-a.png") 方式加载的 会报错Mixed Content: The page at 'https://2.133.129.124/portal/' was loaded over HTTPS, but requested an insecure favicon 'http://2.133.129.124/portal/img/favicon.ico'. This request has been blocked; the content must be served over HTTPs.
时间: 2023-10-08 10:03:58 浏览: 150
同样的,这个报错是因为你的网站已经使用了HTTPS协议,但是在加载"../../img/common/r2-a.png"这个文件时却使用了HTTP协议,导致了Mixed Content错误。解决方法也很简单,只需要将该文件的路径修改为HTTPS即可,比如将"../../img/common/r2-a.png"修改为"https://2.133.129.124/portal/img/common/r2-a.png",这样就可以保证所有的资源都是通过HTTPS协议加载的,避免Mixed Content错误的发生。
相关问题
http修改为https后。原本加载resource/static文件下的ico 会报错Mixed Content: The page at 'https://2.133.129.124/portal/' was loaded over HTTPS, but requested an insecure favicon 'http://2.133.129.124/portal/img/favicon.ico'. This request has been blocked; the content must be served over HTTPs.
这个报错是因为你的网站已经使用了HTTPS协议,但是在加载favicon.ico这个文件时却使用了HTTP协议,这就导致了Mixed Content错误。解决这个问题的方法很简单,只需要将favicon.ico的路径修改为HTTPS即可,比如将'http://2.133.129.124/portal/img/favicon.ico'修改为'https://2.133.129.124/portal/img/favicon.ico'。这样就可以保证所有的资源都是通过HTTPS协议加载的,避免Mixed Content错误的发生。
Not allowed to load local resource: file:///E:/A-project/ldmall-front-vue/src/static/staticimg/common/ico/favicon.ico
This error message typically appears in a web browser console when a website attempts to load a resource (in this case, a favicon) from the user's local file system, rather than from a web server.
The "file://" protocol at the beginning of the URL indicates that the browser is attempting to access a file on the user's computer, which is not allowed for security reasons.
To fix this error, the website should be updated to reference the favicon from a web server using a relative or absolute path, rather than a file path. This will ensure that the resource is loaded from the server rather than the local file system.
阅读全文