js禁止浏览器后退/返回

history.pushState(null, null, document.URL);
window.addEventListener('popstate', function() {
   	history.pushState(null, null, document.URL);
});