From 7ab366d5d42f01d46ad634d354111cd2c24e5532 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Thu, 15 Jan 2026 14:52:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=92=8CAPI=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/pkg/lsxd/login.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/pkg/lsxd/login.go b/internal/pkg/lsxd/login.go index 13b7f1c..fbaa30c 100644 --- a/internal/pkg/lsxd/login.go +++ b/internal/pkg/lsxd/login.go @@ -50,7 +50,7 @@ func (l *Login) GetToken(ctx context.Context) string { if err != nil { log.Errorf("lsxd get token from redis failed, err: %v", err) } - if token != "" && l.checkTokenValid(ctx, token) { + if token != "" /*&& l.checkTokenValid(ctx, token)*/ { return token } @@ -165,7 +165,8 @@ func (l *Login) cacheToken(ctx context.Context, token string) error { if token == "" { return errors.New("token is empty") } - return l.redisCli.Set(ctx, l.getCacheKey(), token, constants.EXPIRE_LSXD_TOKEN).Err() + key := l.getCacheKey() + return l.redisCli.Set(ctx, key, token, constants.EXPIRE_LSXD_TOKEN).Err() } func (l *Login) doRequest(ctx context.Context, method string, url string, authorization string, body []byte) (int, error) {