<script language="JavaScript">
history.pushState(null, null, document.URL.split("?")[0] + "?rand=" + Math.random());
console.log('刷新');
window.addEventListener('popstate', function(event) {
console.log('回退');
// 点击回退时再向历史记录插入一条,以便阻止下一次点击回退
history.pushState(null, null, document.URL.split("?")[0] + "?rand=" + Math.random());
});
</script>