From 7a0ce4b5d6bf1f4c974adf49746f5fd8b2b0d79f Mon Sep 17 00:00:00 2001 From: himawari <54976075+guohuiyuan@users.noreply.github.com> Date: Sat, 6 Nov 2021 18:55:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=BB=99msg=E8=BF=9B=E8=A1=8Curl=E7=BC=96?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E8=A7=A3=E5=86=B3=E9=9D=92=E4=BA=91=E5=AE=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E9=94=99=E8=AF=AF=20(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin_qingyunke/qingyunke.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin_qingyunke/qingyunke.go b/plugin_qingyunke/qingyunke.go index 39a23709..a438bcef 100644 --- a/plugin_qingyunke/qingyunke.go +++ b/plugin_qingyunke/qingyunke.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "math/rand" "net/http" + "net/url" "regexp" "strconv" "strings" @@ -98,13 +99,13 @@ type dataQYK struct { // 青云客取消息 func getMessage(msg string) (string, error) { - url := "http://api.qingyunke.com/api.php" + qykUrl := "http://api.qingyunke.com/api.php" key := "free" appid := "0" - url = fmt.Sprintf(url+"?key=%s&appid=%s&msg=%s", key, appid, msg) + qykUrl = fmt.Sprintf(qykUrl+"?key=%s&appid=%s&msg=%s", key, appid, url.QueryEscape(msg)) client := &http.Client{} - req, err := http.NewRequest("GET", url, nil) + req, err := http.NewRequest("GET", qykUrl, nil) if err != nil { return "", err }