diff --git a/app/http/controllers/front/payment_controller.go b/app/http/controllers/front/payment_controller.go index 39b7bfd..04ca0ea 100644 --- a/app/http/controllers/front/payment_controller.go +++ b/app/http/controllers/front/payment_controller.go @@ -235,5 +235,16 @@ func WxJsApiPay(c *gin.Context) { req.ClientIp = c.ClientIP() rsp, code := thirdpay.WxJsApiPay(*req) - controllers.ApiRes(c, rsp, code, rsp.ThirdMsg) + if code == errorcode.Success { + c.HTML(http.StatusOK, "index.html", gin.H{ + "appId": rsp.AppId, + "timeStamp": rsp.TimeStamp, + "nonceStr": rsp.NonceStr, + "package": rsp.Package, + "signType": rsp.SignType, + "paySign": rsp.PaySign, + }) + } else { + controllers.ApiRes(c, rsp, code, rsp.ThirdMsg) + } } diff --git a/front/templates/index.html b/front/templates/index.html index 33c3b32..2b5b0e7 100644 --- a/front/templates/index.html +++ b/front/templates/index.html @@ -6,47 +6,39 @@