|
12345678910111213141516171819202122 |
- package auth
-
- import (
- "time"
-
- "github.com/dgrijalva/jwt-go"
- )
-
- // TokenExpireDuration is jwt 过期时间
- const (
- TokenKey = "egg_app_jwt_token:%d" // jwt, 占位符:ip, admin:id
- TokenCacheTime = 3600 * 24 * 30 * 6 //半年
- TokenExpireDuration = time.Hour * 24 * 30 * 6 //半年
- )
-
- var Secret = []byte("egg_app")
-
- // JWTUser 如果想要保存更多信息,都可以添加到这个结构体中
- type JWTUser struct {
- Uid int64 `json:"uid"`
- jwt.StandardClaims
- }
|