redis插入数据乱码 解决方法
1、key和value乱码
2、新增配置类
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;
import javax.annotation.PostConstruct;
@Configuration
public class RedisUtils {
@Autowired
private RedisTemplate redisTemplate;
@PostConstruct
public void init() {
共有 0 条评论