Ver código fonte

成员变化的时候时间更新为空问题处理

8 anos atrás
pai
commit
2149f896d6
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4 3
      src/server/models/sessions/sessions.js

+ 4 - 3
src/server/models/sessions/sessions.js

@ -143,7 +143,7 @@ class Sessions extends RedisModel {
                    business_type: businessType
                };
                //如果会话已经存在的就不需要发送会话成功的消息不更新最后一条消息
                redis.hexistsAsync(sessionKey, session).then(function(res){
                redis.hexistsAsync(sessionKey, sessionId).then(function(res){
                    if(res==0){
                        redis.hmsetAsync(sessionKey, session).then(function () {
                            handler(null, session);
@ -1063,7 +1063,7 @@ class Sessions extends RedisModel {
                        } else {
                            message.session_id = sessionId;
                            res.forEach(function (participant) {
                                if (participant.id == message.sender_id){
                                if (participant.id == message.sender_id||sessionType==SESSION_TYPES.SYSTEM){
                                    message.sender_img = participant.avatar;
                                    // if(participant.participant_role == PARTICIPANT_ROLES.REGULAR){
                                    //     if (message.content_type == CONTENT_TYPES.PlainText ||
@ -1288,8 +1288,9 @@ class Sessions extends RedisModel {
                    res =  JSON.parse(res)
                    if (res.status == 200) {
                        let data = res.data;
                        count = JSON.parse(data.imMsgCount).count + data.system.amount + data.healthIndex.amount + data.sign.amount;
                        count = parseInt(JSON.parse(data.imMsgCount).count) + parseInt(data.system.amount) + parseInt(data.healthIndex.amount) + parseInt(data.sign.amount);
                    }
                    console.error("sessionType:"+sessionType+"-->res:"+res)
                    AppClient.sendNotification(targetUserId, message,sessionType,count);
                });
            }