前后端分离,对接时出现的问题,前提是通过postman可以运行:
Optional int parameter 'pageNum' is present but cannot be translated into a null value due to being declared as a primitive type
解析:
问题出现在前端:
① “params”方式,即使是post请求,也会在url后拼接参数,如同:
http://123:8080/xxx/hold/abc/getList.do?pageNum=1&pageSize=5
axios({
method: 'post',
url: "http://123:8080/xxx/hold/abc/getList.do?",
responseType: 'json',
params: {
pageNum: 1,
pageSize: 5,
}
}).then(response => {
②而“data”方式就不会拼接。