利用js实现禁用浏览器后退并触发自定义事件
//防止页面后退
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
showWorkdetail();//触发自定义事件函数
history.pushState(null, null, document.URL);
});

//防止页面后退
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
showWorkdetail();//触发自定义事件函数
history.pushState(null, null, document.URL);
});