The elementui date picker passes the value to the backend and reports a type conversion error

The elementui date picker passes the value to the backend and reports a type conversion error

1. Generally, when you see this, you think of using @DateTimeFormatannotations
. 2. But after using it, you still get an error

Solution: Need to be consistent with the front-end format

Example:
1. Frontend:
insert image description here
2. Backend
insert image description here


Tips:
1. If the value-format of element-ui does not set the time, the value will be as follows: "2022-11-29T16:00:00.000Z"
2. When the backend receives it, it can only receive it with string, and if it uses date, it will also report an error

Guess you like

Origin blog.csdn.net/weixin_42947972/article/details/128332457