Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenAccessTokenAndRefreshToken ¶
func GenAccessTokenAndRefreshToken(info UserAuthInfo) (string, string, error)
func ValidateToken ¶
Types ¶
type UserAuthInfo ¶
type UserAuthInfo struct { UserID int64 `json:"UserID,string"` UserType int `json:"UserType"` Email string `json:"Email"` NickName string `json:"NickName"` LicenseNumber string `json:"LicenseNumber"` CreatedAt time.Time `json:"CreatedAt"` LastLoginAt time.Time `json:"LastLoginAt"` Addr string `json:"Addr"` AddrName string `json:"AddrName"` }
func GetUserAuthInfo ¶
func GetUserAuthInfo(context *gin.Context) UserAuthInfo
func GetUserAuthInfoWS ¶
func GetUserAuthInfoWS(accessToken string) UserAuthInfo
func GetUserInfoFromJwt ¶
func GetUserInfoFromJwt(token *jwt.Token) (*UserAuthInfo, error)
GetUserInfoFromJwt 解析token
func ParseUserInfo ¶
func ParseUserInfo(tokenStr string) (*UserAuthInfo, error)
ParseUserInfo 解析token
func ToUserAuthInfo ¶
func ToUserAuthInfo(user interface{}) (UserAuthInfo, error)
Click to show internal directories.
Click to hide internal directories.