From c54f89e9f8a1a758fc531f72c46c2c2b8ef78b2e Mon Sep 17 00:00:00 2001 From: Vinlic Date: Wed, 13 Mar 2024 22:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0token=E7=9A=84?= =?UTF-8?q?=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/controllers/chat.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/controllers/chat.ts b/src/api/controllers/chat.ts index 9306339..1e44bdb 100644 --- a/src/api/controllers/chat.ts +++ b/src/api/controllers/chat.ts @@ -102,8 +102,10 @@ async function acquireToken(refreshToken: string): Promise { result = await requestToken(refreshToken); accessTokenMap.set(refreshToken, result); } - if (util.unixTimestamp() > result.refreshTime) + if (util.unixTimestamp() > result.refreshTime) { result = await requestToken(refreshToken); + accessTokenMap.set(refreshToken, result); + } return result.accessToken; }