From 8e07c82614b1e8845ccdc8ee9b98defc9dd0f0eb Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Tue, 11 Jun 2024 16:22:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=A3=80=E6=9F=A5=20T?= =?UTF-8?q?OKEN=20=E9=A2=91=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Auth.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/Auth.js b/src/stores/Auth.js index 9314175..f7f31f3 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -114,13 +114,13 @@ const useAuthStore = create((set, get) => ({ const lastReqDate = new Date(LastReqDate) const now = new Date() const diffTime = now.getTime() - lastReqDate.getTime() - const diffHours = diffTime/1000/60//60 - if (diffHours > 1) { + const diffHours = diffTime/1000/60/60 + if (diffHours > 4) { loginTimeout() } } - const interval = setInterval(() => checkTokenTimeout(), 1000)//*60)//*20) + const interval = setInterval(() => checkTokenTimeout(), 1000*60*20) set(() => ({ tokenInterval: interval }))