转自:http://blog.csdn.net/yeyicsdn/article/details/50032787

参考网址:http://www.cnblogs.com/RachelChen/p/5433881.html

修改了前台全局ajax部分代码,如下:

$(document).ajaxComplete(function (event, xhr, settings) {
        //通过XMLHttpRequest取得响应头,sessionstatus,
        var sessionstatus = xhr.getResponseHeader("sessionstatus");
            if (sessionstatus == "timeout") {
                //如果超时就处理 ,指定要跳转的页面
                alert("您已下线,请重新登陆!");
                window.location.href = "/Login/Index";
            }
    });

 

posted on 2017-06-07 19:10  芝麻的西瓜  阅读(728)  评论(0编辑  收藏  举报