This commit is contained in:
aozhiwei 2024-04-27 08:49:54 +08:00
parent cc26a2dd31
commit a6200b2778
3 changed files with 13 additions and 5 deletions

View File

@ -38,7 +38,7 @@ type Player interface {
} }
type PlayerMgr interface { type PlayerMgr interface {
GetPlayerByAccountId() Player GetPlayerByAccountId(string) Player
} }
type Mail interface { type Mail interface {

View File

@ -25,8 +25,8 @@ func GetMailMgr() common.MailMgr {
return mailMgr return mailMgr
} }
func GetPlayerMgr() common.MailMgr { func GetPlayerMgr() common.PlayerMgr {
return mailMgr return playerMgr
} }
func RegModule(idx int32, m q5.Module) { func RegModule(idx int32, m q5.Module) {

View File

@ -2,9 +2,17 @@ package middleware
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"f5" . "main/global"
) )
func CaAuth(c *gin.Context) { func CaAuth(c *gin.Context) {
f5.GetSysLog().Info("CaAuth") accountId := c.DefaultQuery("account_id", "")
//_ := c.DefaultQuery("session_id", "")
hum := GetPlayerMgr().GetPlayerByAccountId(accountId)
if hum == nil {
}
hum.Lock()
c.Next()
hum.UnLock()
} }