Script http跳https

<script>
  let url = window.location.href;
  if (url.indexOf('https') < 0) {
    url = url.replace('http:', 'https:');
    window.location.replace(url);
  }
</script>

本地开发的时候请注释掉以上代码

posted @ 2019-11-16 15:32  神经蛙  阅读(307)  评论(0编辑  收藏  举报