This commit is contained in:
cdle
2021-10-13 10:37:22 +08:00
parent 47bfd04df5
commit e3a5d0f71f
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -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 ?
+5 -3
View File
@@ -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)