使用springsecurity时使用user实现userdetails时,使用@JsonIgnoreProperties注解,可以在User对象在序列化时忽略一些字段,防止报错
org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Unrecognized field “credentialsNonExpired”
在user上面加
@JsonIgnoreProperties({"enabled","accountNonExpired", "accountNonLocked", "credentialsNonExpired", "authorities"})