25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- package auth
-
- import (
- "time"
-
- "github.com/dgrijalva/jwt-go"
- )
-
- // TokenExpireDuration is jwt 过期时间
- const TokenExpireDuration = time.Hour * 4380
- const RefreshTokenExpireDuration = time.Hour * 6
-
- var Secret = []byte("zyos_zhimeng")
- var RSecret = []byte("zyos_zhimeng_refresh_token")
-
- // JWTUser 如果想要保存更多信息,都可以添加到这个结构体中
- type JWTUser struct {
- AdmId int `json:"adm_id"`
- Username string `json:"username"`
- jwt.StandardClaims
- }
-
- // JWTMaster 如果想要保存更多信息,都可以添加到这个结构体中
- type JWTMaster struct {
- MasterId string `json:"master_id"`
- jwt.StandardClaims
- }
|