1.0.0
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user