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" "jccommon"
"main/mt" "main/mt"
"q5" "q5"
"strings"
. "main/global" . "main/global"
@ -55,10 +54,14 @@ func internalMetaMaskJwtAuth(c *gin.Context, jwtToken string) {
ErrMsg string `json:"errmsg"` ErrMsg string `json:"errmsg"`
Decoded struct { Decoded struct {
Id string `json:"id"` Id string `json:"id"`
Uid string `json:"uid"`
Gid string `json:"gid"`
OpenId string `json:"openid"` OpenId string `json:"openid"`
Plat int32 `json:"plat"`
Version int32 `json:"version"` 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"` } `json:"decoded"`
}{} }{}
rspObj := &struct { rspObj := &struct {
@ -99,12 +102,6 @@ func internalMetaMaskJwtAuth(c *gin.Context, jwtToken string) {
f5.GetSysLog().Info("not support this platform:%s", rsp.GetRawData()) f5.GetSysLog().Info("not support this platform:%s", rsp.GetRawData())
return 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() c.Next()
}) })
} }