JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from String "2020-04-21 11:15:10":
Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text '2020-04-21 11:15:10' could not be parsed at index 10; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.time.LocalDateTime` from String "2020-04-21 11:15:10": Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text '2020-04-21 11:15:10' could not be parsed at index 10 at [Source: (PushbackInputStream); line: 11, column: 16] ...
LocalDateTime 是 JDK8 的新特性,并且 LocalDateTime 默认的时间格式是: yyyy-MM-ddTHH:mm:ss,中间多了一个 T 字。我们正常交互上是没有这种 T 字的,所以会造成前后端交互数据的时候出现异常。