Documentation ¶
Index ¶
- Variables
- func ArrayReverse(s []interface{}) []interface{}
- func CreateToken(claims jwt.MapClaims) (string, string, error)
- func Date(format string, timestamp int64) string
- func Get(url string) (response string)
- func InitExpressReg() []map[string]string
- func ParseToken(tokenString string) (jwt.MapClaims, error)
- func Post(url string, data interface{}, contentType string) (content string)
- func ValidToken(tokenString string) (t *jwt.Token, e interface{})
- type CustomClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var JWT_SECRET = config.Param("JWT_SECRET")
Functions ¶
func ArrayReverse ¶
func ArrayReverse(s []interface{}) []interface{}
func InitExpressReg ¶ added in v1.0.3
Types ¶
type CustomClaims ¶
type CustomClaims struct { Openid string `json:"openid"` Userid int `json:"userid"` jwt.StandardClaims }
自定义一个加密token的结构
func CustomerParseToken ¶
func CustomerParseToken(tokenString string) (*CustomClaims, error)
使用自定义结构解析token
Click to show internal directories.
Click to hide internal directories.