数据采集
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 line
651 B

  1. package auth
  2. import (
  3. "time"
  4. "github.com/dgrijalva/jwt-go"
  5. )
  6. // TokenExpireDuration is jwt 过期时间
  7. const TokenExpireDuration = time.Hour * 4380
  8. const RefreshTokenExpireDuration = time.Hour * 6
  9. var Secret = []byte("zyos_zhimeng")
  10. var RSecret = []byte("zyos_zhimeng_refresh_token")
  11. // JWTUser 如果想要保存更多信息,都可以添加到这个结构体中
  12. type JWTUser struct {
  13. AdmId int `json:"adm_id"`
  14. Username string `json:"username"`
  15. jwt.StandardClaims
  16. }
  17. // JWTMaster 如果想要保存更多信息,都可以添加到这个结构体中
  18. type JWTMaster struct {
  19. MasterId string `json:"master_id"`
  20. jwt.StandardClaims
  21. }