Merge branch 'master' of git.u8t.cn:open/gosdk

This commit is contained in:
jiangyong 2025-09-24 13:35:16 +08:00
commit e87107462a
1 changed files with 9 additions and 9 deletions

View File

@ -11,9 +11,9 @@ import (
"git.u8t.cn/open/gosdk/wechat/cache" "git.u8t.cn/open/gosdk/wechat/cache"
"git.u8t.cn/open/gosdk/wechat/message" "git.u8t.cn/open/gosdk/wechat/message"
wutil "git.u8t.cn/open/gosdk/wechat/util" wutil "git.u8t.cn/open/gosdk/wechat/util"
"git.u8t.cn/open/goutil"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"git.u8t.cn/open/goutil"
"github.com/spf13/cast" "github.com/spf13/cast"
"io" "io"
"io/ioutil" "io/ioutil"
@ -68,12 +68,12 @@ type BaseResponse struct {
} }
type AppConfig struct { type AppConfig struct {
Corpid string Corpid string `json:"corpid"`
Secret string Secret string `json:"secret"`
Agent string Agent string `json:"agent"`
Token string Token string `json:"token"`
AesKey string AesKey string `json:"aes_key"`
Replay func(message.MixMessage) *message.Reply Replay func(message.MixMessage) *message.Reply `json:"-"`
} }
type App struct { type App struct {
@ -354,7 +354,7 @@ func (q *App) Callback(ctx *gin.Context) {
_, resp, err := wutil.DecryptMsg(wechatConfig.AppID, ctx.Query("echostr"), wechatConfig.EncodingAESKey) _, resp, err := wutil.DecryptMsg(wechatConfig.AppID, ctx.Query("echostr"), wechatConfig.EncodingAESKey)
if err != nil { if err != nil {
log.Errorf("DecryptMsg failed! appid[%s] aeskey[%s] error:%s ", wechatConfig.AppID, wechatConfig.EncodingAESKey, err.Error()) log.Errorf("DecryptMsg failed! wechatConfig[%s] error:%s ", goutil.EncodeJSON(q.config), err.Error())
return return
} }
ctx.Data(http.StatusOK, "Content-type: text/plain", resp) ctx.Data(http.StatusOK, "Content-type: text/plain", resp)
@ -371,7 +371,7 @@ func (q *App) Callback(ctx *gin.Context) {
server.SetDebug(true) server.SetDebug(true)
err := server.Serve() err := server.Serve()
if err != nil { if err != nil {
log.Errorf("qiye weixin Service [%s] err:%s", goutil.EncodeJSON(wechatConfig), err.Error()) log.Errorf("qiye weixin Service [%s] err:%s", goutil.EncodeJSON(q.config), err.Error())
return return
} }
err = server.Send() err = server.Send()