修复时间问题
This commit is contained in:
parent
c22c609557
commit
99fe27275b
@ -366,11 +366,12 @@ func (c *Container) getToken() error {
|
||||
}
|
||||
} else {
|
||||
logs.Info("缓存token")
|
||||
h, _ := time.ParseDuration("+624h")
|
||||
h, _ := time.ParseDuration("-624h")
|
||||
tZero := time.Now().Add(h)
|
||||
logs.Info(tZero)
|
||||
logs.Info(token.Expiration)
|
||||
if tZero.Before(token.Expiration) {
|
||||
t_ := token.Expiration.Sub(tZero)
|
||||
if t_ > 0 {
|
||||
err2, done := getT(c, token)
|
||||
if done {
|
||||
return err2
|
||||
|
||||
@ -322,5 +322,5 @@ func setSqlToken(token *Token) error {
|
||||
|
||||
func getSqlToken() (*Token, error) {
|
||||
token := &Token{}
|
||||
return token, db.Order("expiration asc").First(token).Error
|
||||
return token, db.Order("expiration desc").First(token).Error
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user