diff --git a/README.md b/README.md index 073c6e5..944c211 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ msgType: text 消息类型,目前只支持文本消息 toTag: 标签ID 在企业微信后台可以查看到 toUser: 用户ID 在企业微信后台可以查看到 toParty: 部门ID 在企业微信后台可以查看到 -text: 要发送的文本消息 +msg: 要发送的消息 ``` [返回到目录](#目录) diff --git a/common/weixin.go b/common/weixin.go index 64782bc..eec1cb4 100644 --- a/common/weixin.go +++ b/common/weixin.go @@ -15,7 +15,7 @@ var ( ) // SendWeixinMessage 发送消息 -func SendWeixinMessage(msgType, text, toTag, toUser, toParty string) (bool, error) { +func SendWeixinMessage(msgType, msg, toTag, toUser, toParty string) (bool, error) { agentID, err := beego.AppConfig.Int64("weixin::warningAppAgentID") if err != nil { return false, fmt.Errorf("get agentID from app.conf error: %s ", err) @@ -29,7 +29,7 @@ func SendWeixinMessage(msgType, text, toTag, toUser, toParty string) (bool, erro AgentID: agentID, // 企业应用的id,整型。可在应用的设置页面查看 Safe: 0, // 表示是否是保密消息,0表示否,1表示是,默认0 Text: &weixin.Text{ - Content: text, + Content: msg, }, }