增加配置

This commit is contained in:
qiyunfanbo126.com 2024-07-10 10:11:32 +08:00
parent db0d3ecf8c
commit d1694f2245
2 changed files with 10 additions and 3 deletions

View File

@ -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

View File

@ -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