root 1 year ago
parent
commit
81f926dbf6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      node/message.js

+ 2 - 2
node/message.js

@@ -616,7 +616,7 @@ us.offLine = function () {
         _user = _connect[i];
         for (j in _user) {
             //判断用户已下线
-            if (_user[j].response.finished) {
+            if (_user[j].response.finished || (_user[j].response.connection == null || _user[j].response.connection.destroyed)) {
                 //if (_user[j].response.connection == null || _user[j].response.connection.destroyed) {
                 //等待五秒后,判断用户是否重连,重连的用户不为下线用户
                 us.offLineByUser(i, j, _user);
@@ -630,7 +630,7 @@ us.offLine = function () {
 */
 us.offLineByUser = function (i, j, _user) {
     setTimeout(() => {
-        if (_user[j].response.finished) {
+        if (_user[j].response.finished || (_user[j].response.connection == null || _user[j].response.connection.destroyed)) {
             var k, istrue = true;
             us.deluser(i, j); //删除用户的数据
             delete _user[j];