From cae5c049e41ba6330ba99a4528b3d8d74bd62a06 Mon Sep 17 00:00:00 2001 From: RockYang Date: Tue, 19 Dec 2023 11:31:57 +0800 Subject: [PATCH] fix: fixed bug for HuPiPay qrcode generation. set field 'openid' of result struct to Any data type --- README.md | 2 ++ api/core/app_server.go | 1 + api/handler/payment_handler.go | 11 ++++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a9010612..bbdbc515 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,8 @@ ChatGLM,讯飞星火,文心一言等多个平台的大语言模型。集成了 ## 项目文档 +**最新的部署视频教程:[https://www.bilibili.com/video/BV1ge411C7uA/](https://www.bilibili.com/video/BV1ge411C7uA/?vd_source=dee8b15703ccfcbd24a60ee9a0fabb73)** + 详细的部署和开发文档请参考 [**ChatGPT-Plus 文档**](https://ai.r9it.com/docs/)。 加微信进入微信讨论群可获取 **一键部署脚本(添加好友时请注明来自Github!!!)。** diff --git a/api/core/app_server.go b/api/core/app_server.go index 9bcd9689..3dd27bfb 100644 --- a/api/core/app_server.go +++ b/api/core/app_server.go @@ -156,6 +156,7 @@ func authorizeMiddleware(s *AppServer, client *redis.Client) gin.HandlerFunc { c.Request.URL.Path == "/api/mj/jobs" || c.Request.URL.Path == "/api/invite/hits" || c.Request.URL.Path == "/api/sd/jobs" || + c.Request.URL.Path == "/api/upload" || strings.HasPrefix(c.Request.URL.Path, "/test/") || strings.HasPrefix(c.Request.URL.Path, "/api/sms/") || strings.HasPrefix(c.Request.URL.Path, "/api/captcha/") || diff --git a/api/handler/payment_handler.go b/api/handler/payment_handler.go index a7561a8d..4a940cee 100644 --- a/api/handler/payment_handler.go +++ b/api/handler/payment_handler.go @@ -99,14 +99,15 @@ func (h *PaymentHandler) DoPay(c *gin.Context) { } var r struct { - Openid int64 `json:"openid"` - UrlQrcode string `json:"url_qrcode"` - URL string `json:"url"` - ErrCode int `json:"errcode"` - ErrMsg string `json:"errmsg"` + Openid interface{} `json:"openid"` + UrlQrcode string `json:"url_qrcode"` + URL string `json:"url"` + ErrCode int `json:"errcode"` + ErrMsg string `json:"errmsg,omitempty"` } err = utils.JsonDecode(res, &r) if err != nil { + logger.Debugf(res) resp.ERROR(c, "error with decode payment result: "+err.Error()) return }