From 7baa915088b8ca8ab9d2c20d5bfefc065e76e176 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 14 Dec 2024 18:39:18 +0800 Subject: [PATCH 1/4] update --- app/hdl/hdl_wallet.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/hdl/hdl_wallet.go b/app/hdl/hdl_wallet.go index 6250126..7cef710 100644 --- a/app/hdl/hdl_wallet.go +++ b/app/hdl/hdl_wallet.go @@ -182,6 +182,10 @@ func WithdrawApply(c *gin.Context) { e.OutErr(c, e.ERR, "支付宝用户信息未授权") return } + if aliInfo.OpenId != "" { + e.OutErr(c, e.ERR, "支付宝用户授权信息有误") + return + } //appId = sysCfgMap[enum.AlipayAppId] userId = aliInfo.UserId openId = aliInfo.OpenId From 46e39596c15b39471087cdf50b55cd4d81f35fee Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 14 Dec 2024 18:41:12 +0800 Subject: [PATCH 2/4] update --- app/hdl/hdl_wallet.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/hdl/hdl_wallet.go b/app/hdl/hdl_wallet.go index 7cef710..2a2118b 100644 --- a/app/hdl/hdl_wallet.go +++ b/app/hdl/hdl_wallet.go @@ -509,6 +509,9 @@ func BindAlipayAccount(c *gin.Context) { e.OutErr(c, e.ERR, err.Error()) return } + fmt.Println("BindAlipayAccount>>>>>>>>", info) + utils.FilePutContents("BindAlipayAccount", utils.SerializeStr(info)) + infoDb := implement.NewAlipayUserInfoDb(db.Db) userInfo, err := infoDb.GetAlipayUserInfo(user.Id) if err != nil { From 652791f2a91508da5910ed55d6ffe67be476287d Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 14 Dec 2024 18:47:31 +0800 Subject: [PATCH 3/4] update --- app/hdl/hdl_wallet.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/hdl/hdl_wallet.go b/app/hdl/hdl_wallet.go index 2a2118b..dc5739b 100644 --- a/app/hdl/hdl_wallet.go +++ b/app/hdl/hdl_wallet.go @@ -510,7 +510,11 @@ func BindAlipayAccount(c *gin.Context) { return } fmt.Println("BindAlipayAccount>>>>>>>>", info) - utils.FilePutContents("BindAlipayAccount", utils.SerializeStr(info)) + utils.FilePutContents("BindAlipayAccount", utils.SerializeStr(map[string]interface{}{ + "info": info, + "systemOauthToken": systemOauthToken, + "req": req, + })) infoDb := implement.NewAlipayUserInfoDb(db.Db) userInfo, err := infoDb.GetAlipayUserInfo(user.Id) From 28584a50f1a46d7bc7cc89bafaa9da3fe79694f0 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 14 Dec 2024 18:56:23 +0800 Subject: [PATCH 4/4] update --- app/hdl/hdl_wallet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/hdl/hdl_wallet.go b/app/hdl/hdl_wallet.go index dc5739b..86e0943 100644 --- a/app/hdl/hdl_wallet.go +++ b/app/hdl/hdl_wallet.go @@ -527,7 +527,7 @@ func BindAlipayAccount(c *gin.Context) { m := model.AlipayUserInfo{ Uid: user.Id, UserId: info.Response.UserId, - OpenId: info.Response.OpenId, + OpenId: systemOauthToken.Response.OpenId, AppId: client.AppId, UserName: info.Response.NickName, Ext: "",