Solve does not match the type of background date when elementui date time picker to submit questions

Problem Description:

  After the front-end date and time elementui selector, by axios when to submit the distal end 400 console occurred (error data type mismatch) error.

 <el-form-item label="跟进时间" prop="traceTime">
                <el-date-picker
                        v-model="customerTraceHistory.traceTime"
                        type="datetime"
                        placeholder="跟进时间">
                </el-date-picker>
 </el-form-item>

 

Error: Notes background issues entity classes

Before the error code:

   @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getTraceTime() {
        return traceTime;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    public void setTraceTime(Date traceTime) {
        this.traceTime = traceTime;
    }

 

After solving the code:

   @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getTraceTime() {
        return traceTime;
    }

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    public void setTraceTime(Date traceTime) {
        this.traceTime = traceTime;
    }

 

Guess you like

Origin www.cnblogs.com/wanghj-15/p/11283851.html