问题

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">

注意

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

Logo

前往低代码交流专区

更多推荐