更新时间:2022-12-07 07:36:19
您不需要在线/离线标记,只需要保存最后活动时间。当显示用户状态时,如果最后活动时间小于现在+ 15分钟,则用户在线,否则离线。
You don't need the online/offline flag, you just need to save the last activitity time. When displaying the user status, if last activity time is less than now+15 minutes then user is online, offline otherwise.