From 13337ce8ed144c11dd004c97c28f5b86f95543d2 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期六, 19 八月 2023 11:53:51 +0800
Subject: [PATCH] 巡检日历
---
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
index 3d41241..710b5d3 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
@@ -142,10 +142,22 @@
public void refreshToken(LoginUser loginUser)
{
loginUser.setLoginTime(System.currentTimeMillis());
- loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
- // 鏍规嵁uuid灏唋oginUser缂撳瓨
- String userKey = getTokenKey(loginUser.getToken());
- redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
+ String appUserType = loginUser.getUser().getAppUserType();
+ if(StringUtils.isNull(appUserType))
+ {
+ loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
+ // 鏍规嵁uuid灏唋oginUser缂撳瓨
+ String userKey = getTokenKey(loginUser.getToken());
+ redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
+ }
+ else
+ {
+ loginUser.setExpireTime(loginUser.getLoginTime() + 365*24*60 * MILLIS_MINUTE);
+ // 鏍规嵁uuid灏唋oginUser缂撳瓨
+ String userKey = getTokenKey(loginUser.getToken());
+ redisCache.setCacheObject(userKey, loginUser, 365*24*60, TimeUnit.MINUTES);
+ }
+
}
/**
--
Gitblit v1.9.3