Commit 3b7f13bd authored by duanjinfei's avatar duanjinfei

Merge branch 'test'

parents 3091a1a1 0079ae41
...@@ -142,15 +142,17 @@ func (c *LotteryController) ForwardReq() { ...@@ -142,15 +142,17 @@ func (c *LotteryController) ForwardReq() {
c.ResponseInfo(500, models.PARAM_ERR, nil) c.ResponseInfo(500, models.PARAM_ERR, nil)
return return
} }
uri, err := erc721.TokenURI(&bind.CallOpts{}, idBigInt) uri := ""
if err != nil || uri == "" { if utils.TokenUriMap[nftAddr] == "" {
c.ResponseInfo(500, models.FAILED, nil) uri, err = erc721.TokenURI(&bind.CallOpts{}, idBigInt)
return if err != nil || uri == "" {
} c.ResponseInfo(500, models.FAILED, nil)
if strings.HasPrefix(uri, "ipfs://") { return
uri = beego.AppConfig.String("beforeEndReqUrl") + uri[7:] }
} if strings.HasPrefix(uri, "ipfs://") {
if utils.TokenUriMap[nftAddr] != "" { uri = beego.AppConfig.String("beforeEndReqUrl") + uri[7:]
}
} else {
uri = utils.TokenUriMap[nftAddr] + id uri = utils.TokenUriMap[nftAddr] + id
} }
client := &http.Client{} client := &http.Client{}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment