Documentation ¶
Index ¶
- Constants
- func CreateToken(secretKey string, claims jwt.Claims) (string, error)
- func GetLoginJwtToken(secretKey string, iat, seconds, userID, role, isAllData int64) (string, error)
- func ParseToken(claim jwt.Claims, tokenString string, secretKey string) error
- func RefreshLoginToken(tokenString string, secretKey string, AccessExpire int64) (string, error)
- type LoginClaims
- type UserInfoType
- type UserStatus
Constants ¶
View Source
const ( RegPhone = "phone" //手机号 (企业版) RegWxOpen = "wxOpen" //微信开放平台登录(企业版) RegWxIn = "wxIn" //微信内登录(企业版) RegWxMiniP = "wxMiniP" //微信小程序(企业版) RegPwd = "pwd" //账号密码注册 )
phone 手机号 wxOpen 微信开放平台 wxIn 微信内 wxMiniP 微信小程序 pwd 账号密码
Variables ¶
This section is empty.
Functions ¶
func GetLoginJwtToken ¶ added in v0.5.1
func ParseToken ¶
解析 token
Types ¶
type LoginClaims ¶ added in v0.5.1
type LoginClaims struct { UserID int64 `json:",string"` Role int64 IsAllData int64 jwt.StandardClaims }
Custom claims structure
type UserInfoType ¶
type UserInfoType uint8
const ( Uid UserInfoType = iota //用户UID InviterUid //邀请人用户id UserName //用户登录名 GroupId //用户组id Email //邮箱 Phone //手机号 Wechat //微信 InfoMax //结束 AuthId //权限id )
func GetLoginNameType ¶
func GetLoginNameType(userName string) UserInfoType
type UserStatus ¶
type UserStatus = int64
const ( NotRegisterStatus UserStatus = iota //未注册完成状态只注册了第一步 NormalStatus //正常状态 )
Click to show internal directories.
Click to hide internal directories.