diff --git a/README.md b/README.md index b57e834..7b6dd68 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ set wxmp masters w1&w2&w3... #set wx relay_mode true -##### 设置指定转发地址,格式为 https://域名/reply?url=%s +##### 设置指定转发地址,格式为 https://域名/relay?url=%s #set wx relaier ? diff --git a/im/wx/init.go b/im/wx/init.go index 9c7edec..ec0d75b 100644 --- a/im/wx/init.go +++ b/im/wx/init.go @@ -17,7 +17,9 @@ import ( ) var wx = core.NewBucket("wx") -var api_url = wx.Get("api_url") +var api_url = func() string { + return wx.Get("api_url") +} var robot_wxid = wx.Get("robot_wxid") func sendTextMsg(pmsg *TextMsg) { @@ -27,7 +29,7 @@ func sendTextMsg(pmsg *TextMsg) { } pmsg.Event = "SendTextMsg" pmsg.RobotWxid = robot_wxid - req := httplib.Post(api_url) + req := httplib.Post(api_url()) req.Header("Content-Type", "application/json") data, _ := json.Marshal(pmsg) enc := mahonia.NewEncoder("gbk") @@ -57,7 +59,7 @@ func sendOtherMsg(pmsg *OtherMsg) { pmsg.Event = "SendImageMsg" } pmsg.RobotWxid = robot_wxid - req := httplib.Post(api_url) + req := httplib.Post(api_url()) req.Header("Content-Type", "application/json") data, _ := json.Marshal(pmsg) req.Body(data)