This commit is contained in:
aozhiwei 2024-11-04 15:28:12 +08:00
parent 51031d9095
commit 25ee6dcf54

View File

@ -6,7 +6,6 @@ import (
"jccommon"
"main/mt"
"q5"
"strings"
. "main/global"
@ -55,10 +54,14 @@ func internalMetaMaskJwtAuth(c *gin.Context, jwtToken string) {
ErrMsg string `json:"errmsg"`
Decoded struct {
Id string `json:"id"`
Uid string `json:"uid"`
Gid string `json:"gid"`
OpenId string `json:"openid"`
Plat int32 `json:"plat"`
Version int32 `json:"version"`
Email string `json:"email"`
Plat int32 `json:"plat"`
PlatVip int32 `json:"platVip"`
Invited string `json:"invited"`
NickName string `json:"nickname"`
} `json:"decoded"`
}{}
rspObj := &struct {
@ -99,12 +102,6 @@ func internalMetaMaskJwtAuth(c *gin.Context, jwtToken string) {
f5.GetSysLog().Info("not support this platform:%s", rsp.GetRawData())
return
}
openId := fmt.Sprintf("%d_2006_%s",
jccommon.BC_CHANNEL,
strings.ToLower(jsonRspObj.Decoded.OpenId))
c.Set("open_id", openId)
c.Set("account_address", strings.ToLower(jsonRspObj.Decoded.OpenId))
c.Set("email", strings.ToLower(jsonRspObj.Decoded.Email))
c.Next()
})
}