diff --git a/src/main/java/com/genersoft/iot/vmp/utils/JsonUtil.java b/src/main/java/com/genersoft/iot/vmp/utils/JsonUtil.java index 6ae56347..60e2dbe2 100644 --- a/src/main/java/com/genersoft/iot/vmp/utils/JsonUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/utils/JsonUtil.java @@ -27,11 +27,10 @@ public final class JsonUtil { * @return result type */ public static T redisJsonToObject(String key, Class clazz) { - JSONObject jsonObject = (JSONObject) RedisUtil.get(key); + Object jsonObject = RedisUtil.get(key); if (Objects.isNull(jsonObject)) { return null; } - return JSON.parseObject(jsonObject.toJSONString(), clazz); + return clazz.cast(jsonObject); } - } \ No newline at end of file