在不能回退的页面上加上下面的代码,终极方案,简单粗暴。
<script language="javascript">
//防止页面后退
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
history.pushState(null, null, document.URL);
});
</script>
还有其他方式,详情可参考下面地址。
参考来源:https://blog.csdn.net/zc474235918/article/details/53138553