RedisUtil调整
This commit is contained in:
parent
94fd3c5817
commit
32e8fdcd08
@ -1,10 +1,12 @@
|
||||
package cn.axzo.pokonyan.config.redis;
|
||||
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.data.redis.RedisSystemException;
|
||||
@ -53,13 +55,12 @@ public class RedisUtil implements InitializingBean {
|
||||
@Override
|
||||
public Object deserialize(byte[] bytes) throws SerializationException {
|
||||
try {
|
||||
return super.deserialize(bytes);
|
||||
return new StringRedisSerializer().deserialize(bytes);
|
||||
} catch (Exception e) {
|
||||
log.warn("object序列化出错,可能不是object类型,使用string序列化,exception:{}",e.getMessage());
|
||||
return new StringRedisSerializer().deserialize(bytes);
|
||||
return super.deserialize(bytes);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user