选择日期保存报错Invalid JSON input: Cannot deserialize value of type `java.util.Date` from String......
(spring boot + vue)
1、新增-选择日期-点击保存-报错:报错信息
"Invalid JSON input: Cannot deserialize value of type `java.util.Date` from String "2020-07-05T16:00:00.000Z": not a valid representation (error: Failed to parse Date value '2020-07-05T16:00:00.000Z': Unparseable date: "2020-07-05T16:00:00.000Z"); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.util.Date` from String "2020-07-05T16:00:00.000Z": not a valid representation (error: Failed to parse Date value '2020-07-05T16:00:00.000Z': Unparseable date: "2020-07-05T16:00:00.000Z")↵ at [Source: (PushbackInputStream); line: 1, column: 445] (through reference chain: com.senyint.hip.saas.base.model.uc.Organization["licenseStartDate"])"
2、解决方案
找到报错的后台实体类,在对应的日期类型上面,加一条注解,即可解决
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
更多推荐
所有评论(0)