zjxpcyc 6 years ago
parent
commit
3fe2abb175
2 changed files with 10 additions and 4 deletions
  1. 6
    4
      controllers/component.go
  2. 4
    0
      service/wechat/wechat.go

+ 6
- 4
controllers/component.go View File

@@ -382,10 +382,12 @@ func (c *WechatController) getReplayMessage(receviceData map[string]string, wech
382 382
 					return
383 383
 				}
384 384
 
385
-				replay = &model.TaAutoReply{
386
-					MessageType:      models.MESSAGE_TYPE_PARAGRAPH,
387
-					MessageParagraph: replyText,
388
-					IsUse:            models.AUTOREPLY_IS_USE_ON,
385
+				if replyText != "" {
386
+					replay = &model.TaAutoReply{
387
+						MessageType:      models.MESSAGE_TYPE_PARAGRAPH,
388
+						MessageParagraph: replyText,
389
+						IsUse:            models.AUTOREPLY_IS_USE_ON,
390
+					}
389 391
 				}
390 392
 			}
391 393
 			break

+ 4
- 0
service/wechat/wechat.go View File

@@ -102,5 +102,9 @@ func (s *WechatServ) GetMenuReplyText(key string) (string, error) {
102 102
 		return "", err
103 103
 	}
104 104
 
105
+	if res == nil {
106
+		return "", nil
107
+	}
108
+
105 109
 	return res.Value, nil
106 110
 }