2022-06-06 14:59阅读: 2859评论: 0推荐: 0

【报错解决】【Vue】与后端交互时,http与https跨域问题

问题


xhr.js:220 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.

场景

Vue前端,Java后端,网站开启了强制https
上传项目后发生了以上报错。

解决方法

在index.html文件中添加
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

注意

我后端早就写了对跨域问题的处理的

posted @   萌狼蓝天  阅读(2859)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
展开