Explorar o código

登录统计完善

zhangweicheng %!s(int64=6) %!d(string=hai) anos
pai
achega
f5dfe6c003
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      logs/online_logs.js

+ 1 - 0
logs/online_logs.js

@@ -13,6 +13,7 @@ async function saveOnlineTime(req) {
     let interval_time = 10 * 60 *1000;
     let start = req.session.online_start_time;
     let end = + new Date();
+    if(start === undefined) return req.session.online_start_time ==end;
     let online_times =  end - start;
     //1秒内只记一次就好
     if(online_times < 500) return;//如果间隔太短,则忽略