mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-21 02:57:56 +08:00
解决不必要的黄线警告
This commit is contained in:
@@ -18,12 +18,13 @@ import java.util.List;
|
|||||||
* sa 缓存处理
|
* sa 缓存处理
|
||||||
*/
|
*/
|
||||||
@JbootSpi("sacache")
|
@JbootSpi("sacache")
|
||||||
|
@SuppressWarnings({"deprecation", "unchecked", "rawtypes"})
|
||||||
public class SaRedisCache implements JbootCache {
|
public class SaRedisCache implements JbootCache {
|
||||||
protected JbootRedisConfig config;
|
protected JbootRedisConfig config;
|
||||||
protected JedisPool jedisPool;
|
protected JedisPool jedisPool;
|
||||||
private ThreadLocal<String> CACHE_NAME_PREFIX_TL = new ThreadLocal<>();
|
private ThreadLocal<String> CACHE_NAME_PREFIX_TL = new ThreadLocal<>();
|
||||||
|
|
||||||
public SaRedisCache(JbootRedisConfig config) {
|
public SaRedisCache(JbootRedisConfig config) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
|
|
||||||
String host = config.getHost();
|
String host = config.getHost();
|
||||||
@@ -111,7 +112,7 @@ public class SaRedisCache implements JbootCache {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T get(String cacheName, Object key) {
|
public <T> T get(String cacheName, Object key) {
|
||||||
Jedis jedis = getJedis();
|
Jedis jedis = getJedis();
|
||||||
try {
|
try {
|
||||||
|
@@ -19,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
/**
|
/**
|
||||||
* 使用Jboot的缓存方法存取Token数据
|
* 使用Jboot的缓存方法存取Token数据
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings({"deprecation", "unchecked", "rawtypes"})
|
||||||
public class SaTokenCacheDao implements SaTokenDao {
|
public class SaTokenCacheDao implements SaTokenDao {
|
||||||
|
|
||||||
protected SaRedisCache saRedisCache;
|
protected SaRedisCache saRedisCache;
|
||||||
|
@@ -35,8 +35,9 @@ public class AppRun extends JbootController {
|
|||||||
renderText("超级管理员方法!");
|
renderText("超级管理员方法!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public void token(String token) {
|
public void token(String token) {
|
||||||
Object t = Jboot.getRedis().get("xxxxx"); //默认redis库
|
Object t = Jboot.getRedis().get("xxxxx"); //默认redis库
|
||||||
SaSession saSession = StpUtil.getSessionByLoginId(StpUtil.getLoginIdByToken(token), false); //satoken redis库
|
SaSession saSession = StpUtil.getSessionByLoginId(StpUtil.getLoginIdByToken(token), false); //satoken redis库
|
||||||
renderJson(saSession);
|
renderJson(saSession);
|
||||||
}
|
}
|
||||||
|
@@ -27,6 +27,7 @@ import com.pj.test.util.SoMap;
|
|||||||
*/
|
*/
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@SpringBootTest(classes = StartUpApplication.class)
|
@SpringBootTest(classes = StartUpApplication.class)
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class LoginControllerTest {
|
public class LoginControllerTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
Reference in New Issue
Block a user