vue+springboot前后端分离项目,后端数据接收的前端数据为null

Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7339a1b0]
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@63ff996a] was not registered for synchronization because synchronization is not active
JDBC Connection [HikariProxyConnection@1019150421 wrapping com.mysql.cj.jdbc.ConnectionImpl@5d116be1] will not be managed by Spring
==> Preparing: insert into admin(name,pwd,phone) values(?,?,?)
==> Parameters: null, null, null

vue+springboot前后端分离项目,在项目添加管理员账户时,后端数据接收的前端数据为null,导致添加失败

在这里插入图片描述

vue+springboot前后端分离项目,后端数据接收的前端数据为null_第1张图片
搜索资料说可能由于传入的参数与后端参数不匹配,查看前端给后端传的表单信息
vue+springboot前后端分离项目,后端数据接收的前端数据为null_第2张图片
Name: “adc”
Phone:“18365476970”
Pwd:“adc123456”

再看后端对应的参数
vue+springboot前后端分离项目,后端数据接收的前端数据为null_第3张图片
破案了!!前端写的首字母大写,后端是小写,把前后端参数统一就ok啦!

vue+springboot前后端分离项目,后端数据接收的前端数据为null_第4张图片
在这里插入图片描述

你可能感兴趣的:(spring,boot,前端,vue.js)