token.go 947 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * @desc:token options
  3. * @company:云南奇讯科技有限公司
  4. * @Author: yixiaohu
  5. * @Date: 2022/3/8 16:02
  6. */
  7. package model
  8. import (
  9. "github.com/gogf/gf/v2/frame/g"
  10. )
  11. type TokenOptions struct {
  12. // server name
  13. ServerName string `json:"serverName"`
  14. // 缓存key (每创建一个实例CacheKey必须不相同)
  15. CacheKey string `json:"cacheKey"`
  16. // 超时时间 默认10天(秒)
  17. Timeout int64 `json:"timeout"`
  18. // 缓存刷新时间 默认5天(秒)
  19. // 处理携带token的请求时当前时间大于超时时间并小于缓存刷新时间时token将自动刷新即重置token存活时间
  20. // MaxRefresh值为0时,token将不会自动刷新
  21. MaxRefresh int64 `json:"maxRefresh"`
  22. // 是否允许多点登录
  23. MultiLogin bool `json:"multiLogin"`
  24. // Token加密key 32位
  25. EncryptKey []byte `json:"encryptKey"`
  26. // 拦截排除地址
  27. ExcludePaths g.SliceStr `json:"excludePaths"`
  28. CacheModel string `json:"cacheModel"`
  29. }