From d0f399a66a06376b441d0e9107bb6201821c4910 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期日, 07 八月 2022 19:30:54 +0800 Subject: [PATCH] 优化xss过滤后格式出现的异常 --- ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java index 2387533..719e9df 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java @@ -75,6 +75,28 @@ } /** + * 鑾峰彇鏈夋晥鏃堕棿 + * + * @param key Redis閿� + * @return 鏈夋晥鏃堕棿 + */ + public long getExpire(final String key) + { + return redisTemplate.getExpire(key); + } + + /** + * 鍒ゆ柇 key鏄惁瀛樺湪 + * + * @param key 閿� + * @return true 瀛樺湪 false涓嶅瓨鍦� + */ + public Boolean hasKey(String key) + { + return redisTemplate.hasKey(key); + } + + /** * 鑾峰緱缂撳瓨鐨勫熀鏈璞°�� * * @param key 缂撳瓨閿�� @@ -210,6 +232,18 @@ } /** + * 鍒犻櫎Hash涓殑鏁版嵁 + * + * @param key + * @param hKey + */ + public void delCacheMapValue(final String key, final String hKey) + { + HashOperations hashOperations = redisTemplate.opsForHash(); + hashOperations.delete(key, hKey); + } + + /** * 鑾峰彇澶氫釜Hash涓殑鏁版嵁 * * @param key Redis閿� -- Gitblit v1.9.3