登录超时后不再统计在线人数

This commit is contained in:
thinkgem
2024-03-12 13:20:33 +08:00
parent 6cf4bebebf
commit 14365a6e76

View File

@@ -7,11 +7,16 @@
function refreshOnlineCount(){ function refreshOnlineCount(){
$.get('${ctx}/sys/online/count?__notUpdateSession=true&__t=' $.get('${ctx}/sys/online/count?__notUpdateSession=true&__t='
+ new Date().getTime(), function(data){ + new Date().getTime(), function(data){
if (!(data && data.result != 'login')){
if (window.rocInt) {
clearInterval(window.rocInt);
}
}
try{$('#onlineCount').html(Number(data))}catch(e){} try{$('#onlineCount').html(Number(data))}catch(e){}
}) })
} }
refreshOnlineCount(); // 先执行一次 refreshOnlineCount(); // 先执行一次
setInterval(refreshOnlineCount, 180000); // 3分钟执行一次 window.rocInt = setInterval(refreshOnlineCount, 180000); // 3分钟执行一次
$(function(){$('#btnOnline').tooltip()}); $(function(){$('#btnOnline').tooltip()});
</script> </script>
</li> </li>