Documentation ¶
Index ¶
- func GetJwtToken(secretKey string, iat, seconds int64, sub string, payload string) (string, error)
- func JwtCommonCreateToken(exp int, UserId uint, key string, loginTime time.Time) (string, int64, error)
- func JwtWithDomainCreateToken(exp int, UserId, TenantID uint, privateKey string, loginTime time.Time) (string, int64, error)
- func JwtWithoutDomainCreateToken(exp int, UserId uint, privateKey string, loginTime time.Time) (string, int64, error)
- type JwtCommonClaims
- type JwtWithDomainCustomClaims
- type JwtWithoutDomainClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJwtToken ¶
@secretKey: JWT 加解密密钥 @iat: 时间戳 @seconds: 过期时间,单位秒 @payload: 数据载体
func JwtCommonCreateToken ¶
Types ¶
type JwtCommonClaims ¶
type JwtCommonClaims struct { UserId uint LoginTime time.Time jwt.StandardClaims }
type JwtWithDomainCustomClaims ¶
type JwtWithDomainCustomClaims struct { UserId uint TenantID uint LoginTime time.Time jwt.StandardClaims }
func JwtWithDomainParseToken ¶
func JwtWithDomainParseToken(tokenString, pubKey string) (*JwtWithDomainCustomClaims, error)
解析 token
type JwtWithoutDomainClaims ¶
type JwtWithoutDomainClaims struct { UserId uint LoginTime time.Time jwt.StandardClaims }
func JwtCommonParseToken ¶
func JwtCommonParseToken(tokenString, key string) (*JwtWithoutDomainClaims, error)
解析 token
func JwtWithoutDomainParseToken ¶
func JwtWithoutDomainParseToken(tokenString, pubKey string) (*JwtWithoutDomainClaims, error)
解析 token
Click to show internal directories.
Click to hide internal directories.