This commit is contained in:
makeyangcom
2024-03-06 10:47:22 +08:00
parent c7da010f01
commit 02dd25ec67
23 changed files with 252 additions and 238 deletions

View File

@@ -1,3 +1,11 @@
/**
#*****************************************************************************
# @file header.go
# @author MakerYang(https://www.makeryang.com)
# @statement 免费课程配套开源项目,任何形式收费均为盗版
#*****************************************************************************
*/
package Utils
import "strings"
@@ -11,39 +19,3 @@ func CheckUserAgent(userAgent string) bool {
return Status
}
func CheckGame(token string) (int, int, bool) {
Status := false
GameId := 0
GameAccountId := 0
if token != "" {
tokenMap, _ := DecodeId(128, token)
if len(tokenMap) == 2 {
GameId = tokenMap[0]
GameAccountId = tokenMap[1]
Status = true
}
}
if GameId == 0 || GameAccountId == 0 {
Status = false
}
return GameId, GameAccountId, Status
}
func CheckUser(token string) (int, bool) {
Status := false
Uid := 0
if token != "" {
tokenMap, _ := DecodeId(32, token)
if len(tokenMap) == 3 {
Uid = tokenMap[0]
Status = true
}
}
return Uid, Status
}