fix(wecom-aibot): correct variable name in JSON parsing in message callback handler

This commit is contained in:
Zhang Rui 2026-02-28 14:04:26 +08:00
parent 6caee427bb
commit c7d4012fc9

View file

@ -351,9 +351,9 @@ func (c *WeComAIBotChannel) handleMessageCallback(
var encryptedMsg struct { var encryptedMsg struct {
Encrypt string `json:"encrypt"` Encrypt string `json:"encrypt"`
} }
if err := json.Unmarshal(body, &encryptedMsg); err != nil { if unmarshalErr := json.Unmarshal(body, &encryptedMsg); unmarshalErr != nil {
logger.ErrorCF("wecom_aibot", "Failed to parse JSON body", map[string]any{ logger.ErrorCF("wecom_aibot", "Failed to parse JSON body", map[string]any{
"error": err, "error": unmarshalErr,
"body": string(body), "body": string(body),
}) })
http.Error(w, "Failed to parse JSON", http.StatusBadRequest) http.Error(w, "Failed to parse JSON", http.StatusBadRequest)