From 5501f6c522d35e719b0881b63aa879eaacbcd4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 11 May 2022 23:47:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20token=20=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E6=97=B6=E9=97=B4=E8=AE=BE=E7=BD=AE=20-1=20=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E5=8D=95=E4=BD=8D=E8=BD=AC=E6=8D=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/satoken/core/dao/PlusSaTokenDao.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/ruoyi-common-satoken/src/main/java/com/ruoyi/common/satoken/core/dao/PlusSaTokenDao.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/com/ruoyi/common/satoken/core/dao/PlusSaTokenDao.java index 8d85d62f..96ee1e40 100644 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/com/ruoyi/common/satoken/core/dao/PlusSaTokenDao.java +++ b/ruoyi-common/ruoyi-common-satoken/src/main/java/com/ruoyi/common/satoken/core/dao/PlusSaTokenDao.java @@ -68,7 +68,8 @@ public class PlusSaTokenDao implements SaTokenDao { */ @Override public long getTimeout(String key) { - return RedisUtils.getTimeToLive(key) / 1000; + long timeout = RedisUtils.getTimeToLive(key); + return timeout < 0 ? timeout : timeout / 1000; } /** @@ -141,7 +142,8 @@ public class PlusSaTokenDao implements SaTokenDao { */ @Override public long getObjectTimeout(String key) { - return RedisUtils.getTimeToLive(key) / 1000; + long timeout = RedisUtils.getTimeToLive(key); + return timeout < 0 ? timeout : timeout / 1000; } /**