1
This commit is contained in:
parent
9d94139ecb
commit
96a020065e
@ -76,7 +76,7 @@ func (ea *RechargeApi) RechargeList(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (this *RechargeApi) Buy(c *gin.Context) {
|
||||
passportAddress := mt.Table.Config.GetEmailBuyerPassportAddress()
|
||||
passportAddress := c.MustGet("account_address").(string)
|
||||
reqJson := struct {
|
||||
NetId int32 `json:"net_id"`
|
||||
GoodsId int32 `json:"goods_id"`
|
||||
@ -94,24 +94,24 @@ func (this *RechargeApi) Buy(c *gin.Context) {
|
||||
|
||||
func (this *RechargeApi) BuyWithEmail(c *gin.Context) {
|
||||
passportAddress := c.MustGet("account_address").(string)
|
||||
email := c.MustGet("email").(string)
|
||||
reqJson := struct {
|
||||
NetId int32 `json:"net_id"`
|
||||
GoodsId int32 `json:"goods_id"`
|
||||
GoodsNum int32 `json:"goods_num"`
|
||||
AccountAddress string `json:"account_address"`
|
||||
CurrencyAddress string `json:"currency_address"`
|
||||
Email string `json:"email"`
|
||||
}{}
|
||||
if err := c.ShouldBindJSON(&reqJson); err != nil {
|
||||
f5.RspErr(c, 1, err.Error())
|
||||
return
|
||||
}
|
||||
if reqJson.Email == "" {
|
||||
if email == "" {
|
||||
f5.RspErr(c, 1, "email is empty")
|
||||
return
|
||||
}
|
||||
this.internalBuy(c, reqJson.NetId, reqJson.GoodsId, reqJson.GoodsNum,
|
||||
reqJson.AccountAddress, passportAddress, reqJson.Email, reqJson.CurrencyAddress)
|
||||
reqJson.AccountAddress, passportAddress, email, reqJson.CurrencyAddress)
|
||||
}
|
||||
|
||||
func (this *RechargeApi) internalBuy(c *gin.Context,
|
||||
|
@ -125,6 +125,7 @@ func internalMetaMaskJwtAuth(c *gin.Context, jwtToken string) {
|
||||
OpenId string `json:"openid"`
|
||||
Plat int32 `json:"plat"`
|
||||
Version int32 `json:"version"`
|
||||
Email string `json:"email"`
|
||||
} `json:"decoded"`
|
||||
}{}
|
||||
rspObj := &struct {
|
||||
@ -169,7 +170,7 @@ func internalMetaMaskJwtAuth(c *gin.Context, jwtToken string) {
|
||||
strings.ToLower(jsonRspObj.Decoded.OpenId))
|
||||
c.Set("open_id", openId)
|
||||
c.Set("account_address", strings.ToLower(jsonRspObj.Decoded.OpenId))
|
||||
c.Set("email", "")
|
||||
c.Set("email", strings.ToLower(jsonRspObj.Decoded.Email))
|
||||
c.Next()
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user