退出登录后,浏览器回跳依旧进入系统
提供一种思路,退出系统后跳转login界面,然后禁用login界面的回退选项,在login页面添加如下js:
$(function() {
$(function(){
//禁用后退按钮
if(window.history && window.history.pushState){
$(window).on('popstate',function(){
window.history.pushState('forward', null, '#');
window.history.forward(1);
});
}
window.history.pushState('forward', null, '#');//兼容IE
window.history.forward(1);
});
});