這個問題是最近遇到的
解決方案我百度的並測試有效
// 如果你希望用戶不用有返回功能 可縮寫如下 或使用location.replace('url')跳轉鏈接 history.pushState(null, null, document.URL); window.addEventListener('popstate', function () { history.pushState(null, null, document.URL); });
注:上面的代碼是禁止頁面返回,其中document.URL可以指定頁面的鏈接來跳轉