From d1694f224507453df598281b8dd4ef013cc5780e Mon Sep 17 00:00:00 2001 From: "qiyunfanbo126.com" <815699> Date: Wed, 10 Jul 2024 10:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/third/youchu/youchu_api.go | 6 +++--- config/config.go | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/third/youchu/youchu_api.go b/app/third/youchu/youchu_api.go index 8a775ae..5b8e380 100644 --- a/app/third/youchu/youchu_api.go +++ b/app/third/youchu/youchu_api.go @@ -173,9 +173,9 @@ func EncryptRequest(request interface{}) (RequestData front.YouChuRequest) { } func DecryptResponse(response string, isRequest bool) (Rsponse string) { - MerchantId := config.GetConf().YouChu.MerchantId - PrivateKey := config.GetConf().Sm2.PrivateKey - PublicKey := config.GetConf().YouChu.SopPublicKey + MerchantId := config.GetConf().YouChuCallBack.MerchantId + PrivateKey := config.GetConf().YouChuCallBack.PrivateKey + PublicKey := config.GetConf().YouChuCallBack.SopPublicKey encrypt, err := postbank.Decrypt(MerchantId, PrivateKey, PublicKey, response, isRequest) if err != nil { return Rsponse diff --git a/config/config.go b/config/config.go index 82308ef..a23dc47 100644 --- a/config/config.go +++ b/config/config.go @@ -37,6 +37,7 @@ type Config struct { Jwt Jwt `toml:"Jwt"` AliOss AliOss `toml:"AliOss"` YouChu YouChuConfig `toml:"YouChu"` + YouChuCallBack YouChuCallBack `toml:"YouChuCallBack"` } type YouChuConfig struct { @@ -52,6 +53,12 @@ type YouChuConfig struct { SopPrivateKey string //服开私钥 } +type YouChuCallBack struct { + MerchantId string //合作方编号 + SopPublicKey string //服开公钥 + PrivateKey string +} + type AliOss struct { AccessKey string AccessKeySecret string