mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-12-27 10:35:58 +08:00
opt: compatible wechat old message format for parsing wechat transfer message
This commit is contained in:
@@ -47,6 +47,20 @@ func parseTransactionMessage(xmlData string) *Message {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 兼容旧版消息记录
|
||||
if message.Url == "" {
|
||||
var msg struct {
|
||||
XMLName xml.Name `xml:"msg"`
|
||||
AppMsg struct {
|
||||
Des string `xml:"des"`
|
||||
Url string `xml:"url"`
|
||||
} `xml:"appmsg"`
|
||||
}
|
||||
if err := xml.Unmarshal([]byte(xmlData), &msg); err == nil {
|
||||
message.Url = msg.AppMsg.Url
|
||||
}
|
||||
}
|
||||
return &message
|
||||
}
|
||||
|
||||
@@ -81,5 +95,6 @@ func extractTransaction(message *Message) Transaction {
|
||||
if err == nil {
|
||||
tx.TransId = parse.Query().Get("id")
|
||||
}
|
||||
|
||||
return tx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user