当前位置:   article > 正文

vue 接口请求域名http想根据网址上的http/https 转换_vue3 怎么根据打开的网站来判断请求域名

vue3 怎么根据打开的网站来判断请求域名

index.html页面
head标签增加下面这句就可以了

<head>
 <script>
      if("https:"=== document.location.protocol){
        document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">');
      }
    </script>
</head>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/天景科技苑/article/detail/770483
推荐阅读
相关标签
  

闽ICP备14008679号