This commit is contained in:
aozhiwei 2024-08-07 14:18:12 +08:00
parent b82844d84c
commit a9fa18e747
2 changed files with 10 additions and 6 deletions

View File

@ -53,8 +53,8 @@ func (this *RechargeApi) Buy(c *gin.Context) {
f5.RspErr(c, 1, err.Error())
return
}
currencyMeta := mt.Table.Contract.GetByNetIdName(reqJson.NetId, "TestToken")
if currencyMeta == nil {
currencyContractMeta := mt.Table.Contract.GetByNetIdName(reqJson.NetId, "TestToken")
if currencyContractMeta == nil {
f5.RspErr(c, 2, "server internal error")
return
}
@ -97,8 +97,8 @@ func (this *RechargeApi) Buy(c *gin.Context) {
"account_address": reqJson.AccountAddress,
"passport_address": passportAddress,
"amount": price,
"currency_name": currencyMeta.GetName(),
"currency_address": currencyMeta.GetAddress(),
"currency_name": currencyContractMeta.GetName(),
"currency_address": currencyContractMeta.GetAddress(),
}
jsonRspObj := &struct {
ErrCode int32 `json:"errcode"`
@ -130,8 +130,8 @@ func (this *RechargeApi) Buy(c *gin.Context) {
reqJson.NetId,
reqJson.AccountAddress,
passportAddress,
currencyMeta.GetName(),
currencyMeta.GetAddress(),
currencyContractMeta.GetName(),
currencyContractMeta.GetAddress(),
goodsMeta.GetId(),
itemNum,
price,

View File

@ -20,3 +20,7 @@ func (this *RechargeCurrencyTable) PostInit1() {
panic("无法读取recharge_currency.json")
}
}
func (this *RechargeCurrencyTable) Get() *RechargeCurrency {
return this.selfConf
}