From c15044b862ac4ec3e09670e204c66d5970a9cb93 Mon Sep 17 00:00:00 2001 From: Rzy <465386466@qq.com> Date: Fri, 9 Aug 2024 18:13:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/constants/errorcode/error_code.go | 2 ++ app/http/controllers/front/api.go | 1 + 2 files changed, 3 insertions(+) diff --git a/app/constants/errorcode/error_code.go b/app/constants/errorcode/error_code.go index a1a2bea..37d766d 100644 --- a/app/constants/errorcode/error_code.go +++ b/app/constants/errorcode/error_code.go @@ -147,6 +147,7 @@ var MsgZH = map[int]string{ RefundOrderNotFound: "退款订单未找到", OrderStatusRefundNotSupport: "订单状态不支持退款", PrePayFail: "预支付失败", + PreRefundFail: "创建退款单失败", } var MsgMap map[string]map[int]string = map[string]map[int]string{"en": MsgZH} @@ -154,6 +155,7 @@ func GetMsg(code int, local string) string { if local == "" { local = "en" } + if msg, ok := MsgMap[local][code]; ok { return msg } diff --git a/app/http/controllers/front/api.go b/app/http/controllers/front/api.go index 67a0b49..ed8db8b 100644 --- a/app/http/controllers/front/api.go +++ b/app/http/controllers/front/api.go @@ -47,6 +47,7 @@ func Refund(c *gin.Context) { refund := thirdpay.ThirdPayRefund(c.Request.Context(), req, appCheckInfo, c.ClientIP()) if refund.PayCode != errorcode.Success { controllers.ApiRes(c, nil, refund.PayCode) + return } data := thirdpay.NewOrdersResp(refund.Order) var res front.ApiResponse