diff --git a/route/charge_r/charge.go b/route/charge_r/charge.go index 94119ccd62b7cac767ffa8910f2cf6e17d35ca1b..689823ba61218b48c645c5fed5c4101581f43513 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 }