1
This commit is contained in:
parent
fae1cbd940
commit
06d2c7e9e7
@ -1,7 +1,8 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
//"main/common"
|
||||
"main/constant"
|
||||
"main/common"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@ -9,5 +10,8 @@ type UserApi struct {
|
||||
}
|
||||
|
||||
func (this *UserApi) Login(c *gin.Context) {
|
||||
//s := c.MustGet("session").(common.Session)
|
||||
s := c.MustGet(constant.SESSION_KEY).(common.Session)
|
||||
if s == nil {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -16,3 +16,7 @@ const (
|
||||
const (
|
||||
PLAT_ID_TG = 5
|
||||
)
|
||||
|
||||
const (
|
||||
SESSION_KEY = "session"
|
||||
)
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"jccommon"
|
||||
"main/mt"
|
||||
"main/common"
|
||||
"main/constant"
|
||||
"q5"
|
||||
|
||||
. "main/global"
|
||||
@ -32,7 +33,7 @@ func internalJwtAuth(c *gin.Context, maybe bool) {
|
||||
} else {
|
||||
if maybe {
|
||||
s := GetSessionMgr().CreateGuestSession()
|
||||
c.Set("session", s)
|
||||
c.Set(constant.SESSION_KEY, s)
|
||||
c.Next()
|
||||
return
|
||||
}
|
||||
@ -94,7 +95,7 @@ func internalMetaMaskJwtAuth(c *gin.Context, jwtToken string) {
|
||||
return
|
||||
}
|
||||
s := GetSessionMgr().CreateJwtSession(jsonRspObj.Decoded)
|
||||
c.Set("session", s)
|
||||
c.Set(constant.SESSION_KEY, s)
|
||||
c.Next()
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user