|
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
import cn.hutool.cache.CacheUtil;
|
|
import cn.hutool.cache.CacheUtil;
|
|
import cn.hutool.cache.impl.CacheObj;
|
|
import cn.hutool.cache.impl.CacheObj;
|
|
import cn.hutool.cache.impl.TimedCache;
|
|
import cn.hutool.cache.impl.TimedCache;
|
|
|
|
+import com.ruoyi.common.core.redis.RedisCache;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -49,9 +50,9 @@ public class TokenService
|
|
protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
|
|
protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
|
|
|
|
|
|
private static final Long MILLIS_MINUTE_TEN = 20 * 60 * 1000L;
|
|
private static final Long MILLIS_MINUTE_TEN = 20 * 60 * 1000L;
|
|
-/*
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
- private RedisCache redisCache;*/
|
|
|
|
|
|
+ private RedisCache redisCache;
|
|
|
|
|
|
private final TimedCache<String, Object> CACHE_OBJECT = CacheUtil.newTimedCache(expireTime * 60 * 1000);
|
|
private final TimedCache<String, Object> CACHE_OBJECT = CacheUtil.newTimedCache(expireTime * 60 * 1000);
|
|
|
|
|
|
@@ -150,7 +151,7 @@ public class TokenService
|
|
String userKey = getTokenKey(loginUser.getToken());
|
|
String userKey = getTokenKey(loginUser.getToken());
|
|
CACHE_OBJECT.put(userKey, loginUser);
|
|
CACHE_OBJECT.put(userKey, loginUser);
|
|
|
|
|
|
- //redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
|
|
|
|
|
|
+ redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|