Documentation ¶
Index ¶
- Constants
- Variables
- type JWTTokenClaims
- type JWTTokenClaimsUserInfo
- type RequestServeAuthCreate
- type RequestServeAuthGuest
- type RequestServeAuthGuestToUser
- type RequestServeAuthLogin
- type RequestServeAuthPassword
- type RequestServeAuthRefresh
- type RequestServeAuthSecurePassword
- type RequestServeAuthTokenByUsernameAndPassword
- type RequestServeAuthTokenID
- type RequestServeAuthUsername
- type RequestServeAuthUsernamePassword
- type RequestServeDistance
- type RequestServeLongitudeLatitude
- type RequestServeOnlineDistance
- type RequestServeOnlineLongitudeLatitude
- type RequestServeUserList
Constants ¶
View Source
const ( TokenTypeSelf = "self" TokenTypeAuth = "auth" TokenTypeGuise = "guise" )
View Source
const ( StatusCodeLoginLimit = 5031 StatusCodeLoginLimitText = "登录限制" )
View Source
const (
UserLevelTourist = iota //游客
)
Variables ¶
View Source
var JWTSigningMethod = jwt.SigningMethodHS512
Functions ¶
This section is empty.
Types ¶
type JWTTokenClaims ¶
type JWTTokenClaims struct { *jwt.StandardClaims *JWTTokenClaimsUserInfo //数据变化,需刷新token获取最新token TokenType string `json:"token_type"` }
type JWTTokenClaimsUserInfo ¶
type JWTTokenClaimsUserInfo struct { UserID primitive.ObjectID `json:"user_id"` ExtensionID int `json:"extension_id"` Name string `json:"name"` Guest bool `json:"guest"` Level int `json:"level"` Experience int `json:"experience"` Roles []model.UserRole `json:"roles"` Tags []model.UserTag `json:"tags"` IP string `json:"ip"` UserAgent string `json:"user_agent"` Location geometry.Point `json:"location"` }
type RequestServeAuthCreate ¶
type RequestServeAuthCreate struct { RequestServeAuthUsernamePassword RequestServeLongitudeLatitude }
type RequestServeAuthGuest ¶
type RequestServeAuthGuest struct {
RequestServeLongitudeLatitude
}
type RequestServeAuthGuestToUser ¶
type RequestServeAuthGuestToUser struct {
RequestServeAuthUsernamePassword
}
type RequestServeAuthLogin ¶
type RequestServeAuthLogin struct { RequestServeAuthUsernamePassword RequestServeLongitudeLatitude }
type RequestServeAuthPassword ¶
type RequestServeAuthPassword struct {
Password string `form:"password" validate:"required"`
}
type RequestServeAuthRefresh ¶
type RequestServeAuthRefresh struct {
RequestServeLongitudeLatitude
}
type RequestServeAuthSecurePassword ¶
type RequestServeAuthSecurePassword struct {
SecurePassword string `form:"secure_password" validate:"required"`
}
type RequestServeAuthTokenByUsernameAndPassword ¶
type RequestServeAuthTokenByUsernameAndPassword struct { RequestServeAuthTokenID RequestServeAuthUsernamePassword }
type RequestServeAuthTokenID ¶
type RequestServeAuthUsername ¶
type RequestServeAuthUsername struct {
Username string `form:"username" validate:"required"`
}
type RequestServeAuthUsernamePassword ¶
type RequestServeAuthUsernamePassword struct { RequestServeAuthUsername RequestServeAuthPassword }
type RequestServeDistance ¶
type RequestServeUserList ¶
type RequestServeUserList struct { UserID primitive.ObjectID `form:"user_id"` ExtensionID int `form:"extension_id"` GuestQuery bool `form:"guest_query"` Guest bool `form:"guest"` Roles []string `form:"roles"` RolesWithTime help.DateTime `form:"roles_with_time"` Tags []string `form:"tags"` TagsWithTime help.DateTime `form:"tags_with_time"` Level int `form:"level"` GteLevel int `form:"gte_level"` LteLevel int `form:"lte_level"` OnlineQuery bool `form:"online_query"` Online bool `form:"online"` RequestServeLongitudeLatitude RequestServeDistance RequestServeOnlineLongitudeLatitude RequestServeOnlineDistance }
Click to show internal directories.
Click to hide internal directories.