From 808cc276e80da50d8649e9394f9fe40bf91ca3e9 Mon Sep 17 00:00:00 2001 From: zhiyang7 Date: Mon, 30 Aug 2021 11:24:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=82=E6=95=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go-wecomchan/wecomchan.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/go-wecomchan/wecomchan.go b/go-wecomchan/wecomchan.go index a6a4368..bdade89 100644 --- a/go-wecomchan/wecomchan.go +++ b/go-wecomchan/wecomchan.go @@ -12,6 +12,7 @@ import ( "net/http" "os" "reflect" + "strings" "time" "github.com/go-redis/redis/v8" @@ -250,7 +251,11 @@ func main() { req.ParseForm() msgContent := req.Form.Get("msg") if len(msgContent) == 0 { - msgContent = req.Form.Get("title") + "\n" + req.Form.Get("desc") + title := req.Form.Get("title") + text := req.Form.Get("text") + desp := req.Form.Get("desp") + msgContent = strings.Join([]string{title, text, desp}, "\n") + log.Println("msgContent=", msgContent) } msgType := req.Form.Get("msg_type") if len(msgType) == 0 {