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 }