From db0cf07f2668ef603cb8e8ce999856e8131f2b67 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Thu, 19 Aug 2021 11:17:37 +0800 Subject: [PATCH] x --- models/pushplus.go | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/models/pushplus.go b/models/pushplus.go index 3293089..454c7bc 100644 --- a/models/pushplus.go +++ b/models/pushplus.go @@ -10,27 +10,21 @@ func pushPlus(token string, content string) { if token == "" { return } + data, _ := json.Marshal(struct { + Token string `json:"token"` + Content string `json:"content"` + Template string `json:"template"` + }{ + Token: token, + Content: content, + Template: "txt", + }) req := httplib.Post("http://pushplus.hxtrip.com/send") req.Header("Content-Type", "application/json") - data, _ := json.Marshal(struct { - Token string `json:"token"` - Content string `json:"Content"` - }{ - Token: token, - Content: content, - }) req.Body(data) req.Response() - req = httplib.Post("http://www.pushplus.plus/send") req.Header("Content-Type", "application/json") - data, _ = json.Marshal(struct { - Token string `json:"token"` - Content string `json:"Content"` - }{ - Token: token, - Content: content, - }) req.Body(data) req.Response() }