From abf730004839213692f22af4775e99ea88fa4072 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Tue, 20 Jun 2023 00:03:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E5=85=85=E5=80=BC=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/charge_r/charge.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/route/charge_r/charge.go b/route/charge_r/charge.go index 94119cc..689823b 100644 --- a/route/charge_r/charge.go +++ b/route/charge_r/charge.go @@ -47,8 +47,9 @@ func CanShareChargeLink(c *gin.Context) (*mycontext.MyContext, error) { return myContext, err } type res struct { - ShareUrl string `json:"shareUrl"` - ShareIcon string `json:"shareIcon"` + ShareUrl string `json:"shareUrl"` + ShareIcon string `json:"shareIcon"` + RechargeUrl string `json:"rechargeUrl"` } // 安卓3.8.0版本有bug,这里暂时兼容 @@ -57,16 +58,17 @@ func CanShareChargeLink(c *gin.Context) (*mycontext.MyContext, error) { if err != nil { return myContext, err } + myUser, err := user_c.GetUserTinyById(model, userId) + if err != nil { + return myContext, err + } if deviceType == "android" { if (major > 3) || (major == 3 && minor >= 8) { - myUser, err := user_c.GetUserTinyById(model, userId) - if err != nil { - return myContext, err - } shareUrl = shareUrl + myUser.ExternalId } } + rechargeUrl := config.GetH5Config().AGENT_SHARE_URL + myUser.ExternalId - resp.ResponseOk(c, res{shareUrl, config.GetH5Config().AGENT_SHARE_ICON}) + resp.ResponseOk(c, res{shareUrl, config.GetH5Config().AGENT_SHARE_ICON, rechargeUrl}) return myContext, nil } -- 2.22.0