参考
https://blog.csdn.net/sinat_34368775/article/details/77946350?skintest=skin3-template-test
//检测到在本页,按返回按钮 window.addEventListener("popstate", function (e) { //检测到用户点击浏览器返回按钮,进行操作 console.log(document.referrer); //使用href的形式去用跳转的形式,跳转到上一页 document.location.href = youWantToUrl }, false); var state = { title: "", url: "" }; window.history.pushState(state, "", "");