增加配置
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) {
|
func DecryptResponse(response string, isRequest bool) (Rsponse string) {
|
||||||
MerchantId := config.GetConf().YouChu.MerchantId
|
MerchantId := config.GetConf().YouChuCallBack.MerchantId
|
||||||
PrivateKey := config.GetConf().Sm2.PrivateKey
|
PrivateKey := config.GetConf().YouChuCallBack.PrivateKey
|
||||||
PublicKey := config.GetConf().YouChu.SopPublicKey
|
PublicKey := config.GetConf().YouChuCallBack.SopPublicKey
|
||||||
encrypt, err := postbank.Decrypt(MerchantId, PrivateKey, PublicKey, response, isRequest)
|
encrypt, err := postbank.Decrypt(MerchantId, PrivateKey, PublicKey, response, isRequest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Rsponse
|
return Rsponse
|
||||||
|
|
|
@ -37,6 +37,7 @@ type Config struct {
|
||||||
Jwt Jwt `toml:"Jwt"`
|
Jwt Jwt `toml:"Jwt"`
|
||||||
AliOss AliOss `toml:"AliOss"`
|
AliOss AliOss `toml:"AliOss"`
|
||||||
YouChu YouChuConfig `toml:"YouChu"`
|
YouChu YouChuConfig `toml:"YouChu"`
|
||||||
|
YouChuCallBack YouChuCallBack `toml:"YouChuCallBack"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type YouChuConfig struct {
|
type YouChuConfig struct {
|
||||||
|
@ -52,6 +53,12 @@ type YouChuConfig struct {
|
||||||
SopPrivateKey string //服开私钥
|
SopPrivateKey string //服开私钥
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type YouChuCallBack struct {
|
||||||
|
MerchantId string //合作方编号
|
||||||
|
SopPublicKey string //服开公钥
|
||||||
|
PrivateKey string
|
||||||
|
}
|
||||||
|
|
||||||
type AliOss struct {
|
type AliOss struct {
|
||||||
AccessKey string
|
AccessKey string
|
||||||
AccessKeySecret string
|
AccessKeySecret string
|
||||||
|
|
Loading…
Reference in New Issue