附近小店
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.

base.go 642 B

3 months ago
12345678910111213141516171819202122232425
  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 * 4380
  9. var Secret = []byte("zyos")
  10. // JWTUser 如果想要保存更多信息,都可以添加到这个结构体中
  11. type JWTUser struct {
  12. UID int `json:"uid"`
  13. Username string `json:"username"`
  14. Phone string `json:"phone"`
  15. AppName string `json:"app_name"`
  16. MiniOpenID string `json:"mini_open_id"` // 小程序的open_id
  17. MiniSK string `json:"mini_session_key"` // 小程序的session_key
  18. jwt.StandardClaims
  19. }