问题原因所在:前端Vue传输的数据字段类型和后端实体类字段不一致。
我的实体类字段是int类型。前端传输的数据是布尔类型。

1、后端方法

    @RequestMapping(value = "/car/editCar", method = RequestMethod.PUT)
public Result updateOneUser(@RequestBody Car car) {
int rs = carService.updateCar(car);
if (rs > 0) {
return Result.ok();
} else {
throw new BusinessException(ResultCode.UPDATE_USER_ERROR.getCode(),
ResultCode.UPDATE_USER_ERROR.getMessage());
} }

2、实体类字段

报错信息

2、前端传输的数据

            <el-button type="primary" @click="editCar(scope.$index,scope.row)" icon="el-icon-edit" circle>编辑</el-button>

调用方法打开窗口的方法,将数据写入弹窗中

     editCar(index, row) {
this.dialogVisible = true;//dialog对话窗口打开
this.editForm = Object.assign({}, row);//将数据传入dialog页面
this.editForm.index=index;//传递当前index },

点击弹窗form表单的提交按钮

    <el-button type="primary" @click="update('editForm')">确 定</el-button>

再次调用方法

      update(formName) {
const _this = this;
this.editForm.status=0 //直接设置值,
console.log(this.editForm)
this.$refs[formName].validate((valid) => {
if (valid) {
axios.put('/car/editCar',this.editForm).then(function (resp) {
if(resp.data.code==200){
_this.$alert('修改成功', '消息', {
confirmButtonText: '确定',
callback: action => {
_this.dialogVisible = false;//dialog对话窗口关闭
_this.showAllUsers();
}
}); }
})
}
});
},

JSON parse error: Cannot deserialize value of type `java.lang.Integer` from Boolean value的更多相关文章

  1. JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from String

    在使用Postman测试Spring Boot项目接口时,接口返回JSON parse error: Cannot deserialize value of type `java.time.Local ...

  2. JSON parse error: Cannot deserialize value of type `java.util.Date` from String

    DateTimePicker + @DateTimeFormat("yyyy-MM-dd HH:mm:ss")日期格式转换异常 最近在做的一个项目使用的日期格式是yyyy-MM-d ...

  3. JSON parse error: Cannot deserialize instance of `int` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc

    代码程序: @PostMapping("selectById") @ResponseBody public Result selectById(@RequestBody int i ...

  4. JSON parse error: default constructor not found. class java.time.YearMonth; nested exception is com.alibaba.fastjson.JSONException: default constructor not found. class java.time.YearMonth

    java8新出的YearMonth可以方便的用来表示某个月.我的项目中使用springmvc来接收YearMonth类型的数据时发现 x-www-from-urlencoded 格式的数据可以使用&q ...

  5. no suitable HttpMessageConverter found for request type [java.lang.Integer]

    今天在使用Spring Template的时候遇到了这个异常: no suitable HttpMessageConverter found for request type [java.lang.I ...

  6. springMVC 报错:Unknown return value type: java.lang.Integer

    controller层返回值类型为Integer,运行报错: Unknown return value type: java.lang.Integer 解决办法:在此方法上写上注解 @Response ...

  7. org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [41] did not match expected type [java.lang.Integer (n/a)];

    题记:以前记录过一些自己遇到的BUG,这个行为,让我一看报错的提示信息就能定位到问题的所在,后来记得比较多了,好多是重复性的再加上比较忙就没有详细的记录了,今天的工作量比较小,就顺便记录一下,以便以后 ...

  8. org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.Integer

    使用hibernate时,在save方法时,报了:org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.In ...

  9. springMVC中Unknown return value type: java.lang.Integer(解决)

    controller层返回值类型为Integer,然而报 Unknown return value type: java.lang.Integer 这个错误,500错误 解决办法:在此方法上写上注解@ ...

随机推荐

  1. jquery转换为同步请求

    $.ajax({ async: false, //采用异步的方式提交,不添加默认是异步,布尔值为 true type : 'POST', url : 'https://i-beta.cnblogs.c ...

  2. SkiaSharp 之 WPF 自绘 投篮小游戏(案例版)

    此案例主要是针对光线投影法碰撞检测功能的示例,顺便做成了一个小游戏,很简单,但是,效果却很不错. 投篮小游戏 规则,点击投篮目标点,就会有一个球沿着相关抛物线,然后,判断是否进入篮子里,其实就是一个矩 ...

  3. OSSCore 开源解决方案介绍

    基于.NetCore的积木化服务框架,主要将常规解决方案进行进一步的抽象下沉形成相关基础可选框架单元(在Framework 目录),并在此基础上实现常规系统模块(在Modules 目录),如用户管理, ...

  4. 使用Fiddler劫持网络资源为前端开发助力(示例:Dynamic CRM 表单开发 也能热更新? )

    背景: 使用过vue开发的童鞋应该都知道,在开发vue项目的过程中,有个叫"热更新"的功能特别爽,在传统html开发到初次接触vue时,才发现原来前端开发可以这么香.热更新的表现形 ...

  5. jQuery 选择器选中某节点,在后续的链式操作函数内使用 $(this) 的结果是 Window 对象,而非该节点对象

    <ul class="tree-ocx"> <li class="tree-ocx-li" data-displayed="fals ...

  6. 云服务器上搭建cobalt strike遇到的一些小问题

    一.前言: 当你兴高采烈的买了一台云服务器,迫不及待地想去搭建传说中的神器cobalt strike的时候,你可能会遇到以下的一些小问题,这里我会列出对应的解决方法. 二.遇到的一些小问题 1.上传文 ...

  7. 第九十七篇:CSS的选择器及优先级

    好家伙,来补一点关于CSS的基础 1.id选择器 id 选择器可以为标有特定 id 的 HTML 元素指定特定的样式 使用#号来定义样式 2.class选择器 class 选择器用于描述一组元素的样式 ...

  8. JavaWeb核心篇(2)——Request和Response

    JavaWeb核心篇(2)--Request和Response 上篇文章中提及到了Servlet,在Servlet中我们主要继承了HTTPServlet类,在HTTPServlet类中我们会接触到两个 ...

  9. MAC MySQL安装配置

    1. 下载 下载地址:https://dev.mysql.com/downloads/mysql/ 注意选择对应的版本,M系列芯片对应ARM 2. 安装 参考官网教程, 点击地址查看, 一直点击继续即 ...

  10. Linux系统编程001--系统IO

    1. 文件系统:用来存储.组织.管理文件的一套方式.协议 2. 文件 文件的属性:i-node唯一表示一个文件的存在与否 文件的内容 3. Linux系统如何实现文件的操作? 点击查看代码 硬件层: ...