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