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