This commit is contained in:
jiangyong27 2024-07-18 21:34:48 +08:00
parent c0d9ac7420
commit 2faf742410
1 changed files with 2 additions and 2 deletions

View File

@ -348,13 +348,13 @@ func (q *App) Callback(ctx *gin.Context) {
sign := wutil.Signature(ctx.Query("timestamp"), ctx.Query("echostr"),
ctx.Query("nonce"), wechatConfig.Token)
if sign != ctx.Query("msg_signature") {
log.Errorf("sign error forcheck config")
log.Errorf("sign error forcheck config! token[%s]", wechatConfig.Token)
return
}
_, resp, err := wutil.DecryptMsg(wechatConfig.AppID, ctx.Query("echostr"), wechatConfig.EncodingAESKey)
if err != nil {
log.Errorf("DecryptMsg failed! error:%s", err.Error())
log.Errorf("DecryptMsg failed! appid[%s] aeskey[%s] error:%s ", wechatConfig.AppID, wechatConfig.EncodingAESKey, err.Error())
return
}
ctx.Data(http.StatusOK, "Content-type: text/plain", resp)