问题原因所在:前端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. 从-99打造Sentinel高可用集群限流中间件

    接上篇Sentinel集群限流探索,上次简单提到了集群限流的原理,然后用官方给的 demo 简单修改了一下,可以正常运行生效. 这一次需要更进一步,基于 Sentinel 实现内嵌式集群限流的高可用方 ...

  2. 配置 Druid 数据源及密码加密-SpringBoot 2.7 实战基础

    在SpringBoot中配置 Druid 数据源及密码加密的方法 前文集成 MyBatis Plus,实现了一组增删改查接口.在启动服务时,从控制台中可以看出 Spring Boot 默认使用 Hik ...

  3. 故障案例 | lsof是怎么"影响"MySQL计算打开文件句柄数的

    欢迎来到 GreatSQL社区分享的MySQL技术文章,如有疑问或想学习的内容,可以在下方评论区留言,看到后会进行解答 lsof中附加不同参数产生的结果也不同,小心"踩坑". 1. ...

  4. 游戏开发常遇到数据一致性BUG,怎么解?

    摘要:数据副本强一致.全节点可写.存储全面降本,GaussDB(for Redis)重新定义游戏数据库,彻底修复一致性BUG. 本文分享自华为云社区<华为云GaussDB(for Redis)揭 ...

  5. 解决beego运行程序报错问题:stderr: go: github.com/astaxie/beego@v1.12.1: missing go.sum entry

    使用命令bee new beegodemo02创建beego程序后,使用VScode打开后,便会报错无法运行,报错信息如下: Error loading workspace: err: exit st ...

  6. 即席查询(Ad Hoc)如何做到又快又稳?

    数字化与数字生态建设,是当前所有企业成长发展的必经之路.随着"加强新型基础设施建设"第一次被写入政府工作报告,5G.人工智能.工业互联网.智慧城市等新型基建彻底激发了数字的价值. ...

  7. KingbaseES 数据库参数优化

    一.数据库应用类型 针对不同的应用模型,需要对数据库配置进行优化: 1.网络应用程序(WEB) ​通常受 CPU 限制 DB比RAM小得多 90% 或更多的简单查询 2.在线事务处理 (OLTP) ​ ...

  8. mac_VMWare安装总结

    MacOS 安装VmWare 总结 如果之前安装过virtualBox,virtualBox的内核扩展会影响到VmWare的使用 *比如会导致VMWare虽然可以安装,却无法创建虚拟机 这是需要执行以 ...

  9. QT学习(五)----360界面制作(2终结)

    继续上一章的360新特性界面.源代码:http://download.csdn.net/detail/zhangyang1990828/5241242 上一章中实现了整个界面的纯UI设计,这次我们让它 ...

  10. 我的Vue之旅、04 CSS媒体查询完全指南(Media Quires)

    什么是SCSS Sass: Sass Basics (sass-lang.com) SCSS 是 CSS 的预处理器,它比常规 CSS 更强大. 可以嵌套选择器,更好维护.管理代码. 可以将各种值存储 ...