Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomerClaim ¶
type CustomerClaim struct { TokenUserClaim *jwt.StandardClaims }
聚合jwt内部实现的Claims
type ITokenService ¶
type ITokenService interface { Encode(user TokenUserClaim) (string, error) Decode(tokenString string) (*CustomerClaim, error) }
type TokenService ¶
type TokenService struct{}
实现token服务
var JwtService *TokenService
func (*TokenService) Decode ¶
func (tks *TokenService) Decode(tokenString string) (*CustomerClaim, error)
token字符串解码成用户信息
func (*TokenService) Encode ¶
func (tks *TokenService) Encode(user TokenUserClaim) (string, error)
传入用户信息编码成token
type TokenUserClaim ¶
JWT中携带的用户个人信息
Click to show internal directories.
Click to hide internal directories.