diff --git a/modules/auth/wechat/event_handle.go b/modules/auth/wechat/event_handle.go index 757d6498a..9e05f5e6e 100644 --- a/modules/auth/wechat/event_handle.go +++ b/modules/auth/wechat/event_handle.go @@ -4,6 +4,7 @@ import ( "code.gitea.io/gitea/modules/redis/redis_client" "code.gitea.io/gitea/modules/redis/redis_key" "encoding/json" + "encoding/xml" "strings" "time" ) @@ -29,7 +30,8 @@ type WechatEvent struct { Ticket string } -type Xml struct { +type EventReply struct { + XMLName xml.Name `xml:"xml"` ToUserName string FromUserName string CreateTime int64 diff --git a/routers/authentication/wechat_event.go b/routers/authentication/wechat_event.go index 67149de5d..35ba23166 100644 --- a/routers/authentication/wechat_event.go +++ b/routers/authentication/wechat_event.go @@ -25,7 +25,7 @@ func AcceptWechatEvent(ctx *context.Context) { log.Info("reply str is empty") return } - reply := &wechat.Xml{ + reply := &wechat.EventReply{ ToUserName: we.FromUserName, FromUserName: we.ToUserName, CreateTime: time.Now().Unix(),