修改jwt有效期
This commit is contained in:
parent
9eb46b41cf
commit
81e89623e7
@ -23,6 +23,10 @@ func (t Token) NewJWT() (string, error) {
|
||||
return "", errors.New("登录失败")
|
||||
}
|
||||
|
||||
if config.C.Env == "dev" {
|
||||
duration = 5 * time.Minute
|
||||
}
|
||||
|
||||
t.RegisteredClaims.ExpiresAt = jwt.NewNumericDate(time.Now().Add(duration)) // 过期时间24小时
|
||||
t.RegisteredClaims.IssuedAt = jwt.NewNumericDate(time.Now()) // 签发时间
|
||||
t.RegisteredClaims.NotBefore = jwt.NewNumericDate(time.Now()) // 生效时间
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user