From ad637de10ee7234a76148860b044ff526d409552 Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Fri, 3 Sep 2021 07:56:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=87=E6=9C=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/container.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/models/container.go b/models/container.go index 961f637..c9478f2 100644 --- a/models/container.go +++ b/models/container.go @@ -369,6 +369,7 @@ func (c *Container) getToken() error { h, _ := time.ParseDuration("+24d") tZero := time.Now().Add(h) logs.Info(tZero) + logs.Info(token.expiration) if tZero.After(token.expiration) { err2, done := getT(c, token) if done { @@ -376,8 +377,6 @@ func (c *Container) getToken() error { } } else { logs.Info("获取缓存成功") - logs.Info(token.Token) - logs.Info(token.expiration) c.Token = token.Token } } @@ -412,7 +411,7 @@ func getT(c *Container, token *Token) (error, bool) { } c.Token, _ = jsonparser.GetString(data, "data", "token") token.Token, _ = jsonparser.GetString(data, "data", "token") - token.expiration = time.Time{}.Local() + token.expiration = time.Now() setSqlToken(token) logs.Info(c.Token) } else {