js禁止浏览器页面后退功能:

<script>
    $(function(){
            if(window.location.href.indexOf("/login") > -1) {
                //防止页面后退
                   history.pushState(null, null, document.URL);
                   window.addEventListener('popstate', function () {
                        history.pushState(null, null, document.URL);
                    });
            }
    });
</script>

 

相关文章:

  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
  • 2021-07-17
相关资源
相似解决方案