增加配置
This commit is contained in:
parent
d1694f2245
commit
8ac01cf6e5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue