解决Mixed Content:the page at‘https://‘ was loaded over HTTPS,but requested an insecure resource ‘http
生活随笔
收集整理的這篇文章主要介紹了
解决Mixed Content:the page at‘https://‘ was loaded over HTTPS,but requested an insecure resource ‘http
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
解決Mixed Content:the page at‘https://’ was loaded over HTTPS,but requested an insecure resource ‘http://’
問題:在Vue項目中使用axios訪問了一個http協議的接口,報錯如下
查資料后發現原因是在https中請求http接口或引入http資源都會被直接blocked(阻止),瀏覽器默認此行為不安全,會攔截。
解決辦法:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />在頁面中加上此meta標簽,原理是使用META標簽強制將http請求轉成https(SSL協議)請求。
參考
https://www.cnblogs.com/527xyz/p/14870576.html
總結
以上是生活随笔為你收集整理的解决Mixed Content:the page at‘https://‘ was loaded over HTTPS,but requested an insecure resource ‘http的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 精仿高仿捕鱼达人游戏Android源码
- 下一篇: win10开启IIS及其配置