增加配置

This commit is contained in:
qiyunfanbo126.com 2024-07-10 13:50:24 +08:00
parent d1694f2245
commit 8ac01cf6e5
1 changed files with 11 additions and 3 deletions

View File

@ -173,9 +173,17 @@ func EncryptRequest(request interface{}) (RequestData front.YouChuRequest) {
}
func DecryptResponse(response string, isRequest bool) (Rsponse string) {
MerchantId := config.GetConf().YouChuCallBack.MerchantId
PrivateKey := config.GetConf().YouChuCallBack.PrivateKey
PublicKey := config.GetConf().YouChuCallBack.SopPublicKey
var MerchantId, PrivateKey, PublicKey string
if isRequest {
MerchantId = config.GetConf().YouChuCallBack.MerchantId
PrivateKey = config.GetConf().YouChuCallBack.PrivateKey
PublicKey = config.GetConf().YouChuCallBack.SopPublicKey
} else {
MerchantId = config.GetConf().YouChu.MerchantId
PrivateKey = config.GetConf().Sm2.PrivateKey
PublicKey = config.GetConf().YouChu.SopPublicKey
}
encrypt, err := postbank.Decrypt(MerchantId, PrivateKey, PublicKey, response, isRequest)
if err != nil {
return Rsponse