后台session过期,tomcat重启,自动跳转页面js写法

if (window != top) {
    //top.location.href = location.href;//因为系统分为普通用户和后台,所以暂时写死
    if(top.location.href.indexOf('${pageContext.request.contextPath}/main/index')>0){
        top.location.href = 'login_toLogin';
    }
}

点击后跳转到后台地址

原文地址:https://www.cnblogs.com/zrui-xyu/p/5805608.html