Browse Source

update

master
shenjiachi 5 days ago
parent
commit
886386e1ac
2 changed files with 9 additions and 5 deletions
  1. +8
    -5
      app/hdl/hdl_wallet.go
  2. +1
    -0
      go.mod

+ 8
- 5
app/hdl/hdl_wallet.go View File

@@ -20,6 +20,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/go-pay/gopay"
"github.com/jinzhu/copier"
"net/url"
"time"
)

@@ -412,8 +413,7 @@ func LaunchBindAlipayAccount(c *gin.Context) {
return
}

var alipayStruct *alipay.InitAlipayStruct
client, err := alipay.InitAlipay(alipayStruct)
client, err := alipay.InitAlipay(nil)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
@@ -421,9 +421,12 @@ func LaunchBindAlipayAccount(c *gin.Context) {
appId := client.AppId
redirectUri := req.RedirectUri
scope := "auth_user"
url := fmt.Sprintf("https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=" + appId + "&scope=" + scope + "&redirect_uri=" + redirectUri)

e.OutSuc(c, url, nil)
reqUrl := fmt.Sprintf("https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=%s&redirect_uri=%s", appId, scope, redirectUri)
reqUrl = url.QueryEscape(reqUrl)
res := "alipays://platformapi/startapp?appId=20000067&url=" + reqUrl

e.OutSuc(c, res, nil)
}

// BindAlipayAccount
@@ -456,7 +459,7 @@ func BindAlipayAccount(c *gin.Context) {
return
}

var bm gopay.BodyMap
bm := make(gopay.BodyMap)
bm = bm.Set("grant_type", "authorization_code")
bm = bm.Set("code", req.AuthCode)



+ 1
- 0
go.mod View File

@@ -36,6 +36,7 @@ require (
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241129083357-e0e1afc0ff46
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5
github.com/alibabacloud-go/darabonba-encode-util v0.0.2
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
github.com/gin-contrib/sessions v1.0.1
github.com/go-pay/crypto v0.0.1


Loading…
Cancel
Save