报错, nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException

问题:
2021-03-23 16:57:28.461 ERROR 7912 --- [io-12000-exec-1] c.y.w.c.GlobalControllerExceptionHandler : Exception: JSON parse error: Cannot deserialize instance of `cn.yihuazt.cols.entity.Entrys` out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `cn.yihuazt.cols.entity.Entrys` out of START_ARRAY token
 at [Source: (PushbackInputStream); line: 1, column: 1]

原因:

前端传值类型和后端接收类型不一致,修改template类型


解决:
template:{
  templateId:'',
  templateName:'',
  templateType:'',
  tableData: [],
},

saveAtmMenu:function(){
let me =this;
if (me.template.tableData!=null&&me.template.tableData.size>0){
  me.template.templateName='ATM模板'+Math.round(Math.random()*10000);
  me.template.templateType=0;
  me.template.tableData=me.tableData;
  me.$http
    .post('api/cols/template/saveAtmMenu',me.template)
    .then(res=>{
      this.closeAllPage();
    });
}
}

你可能感兴趣的:(vue,vue)