加到:phpcms/modules/admin/templates/index.tpl.php页脚的</script>上面
var maxTime = 30*60; // seconds var time = maxTime; $('body').on('keydown mousemove mousedown', function(e){ time = maxTime; // reset }); var intervalId = setInterval(function(){ time--; if(time <= 0) { ShowInvalidLoginMessage(); clearInterval(intervalId); } }, 1000) function ShowInvalidLoginMessage(){ location.href = "?m=admin&c=index&a=public_logout"; }
监测鼠标活动,不活动超过30分钟(30*60=1800秒)自动退出后台。