(function () { var startTime = (new Date).getTime(), //进入页面时间 interval = 0, //进入页面到现在间隔了多少秒 clock; //每500毫秒计算一次 clock = setInterval(function () { interval = Math.ceil(((new Date).getTime() - startTime) / 1000); if (interval >60*30) { clearInterval(clock); callback(); } }, 500); function callback() { //TODO clear cookies ShowInvalidLoginMessage(); //alert('cookies过期'); } function ShowInvalidLoginMessage(){ var send = {send:'1'}; $.post(base_url+'member/session_logout/', send, function(res){ if (0 === res.error) { // setTimeout('window.location.href="http://lccs.p2pworks.com/member/double"',500); window.location.href=base_url+"member/overtimeflag_login"; } else { } }, 'json'); } })();
js判断用户超时登录
最新推荐文章于 2022-06-29 22:07:18 发布