searchList是一个JSON数组,[{"id":"1","name":"A"},{"id":"2","name":"B"},{"id":"3","name":"C"},{"id":"4","name":"D"},{"id":"5","name":"E"}],后端controller如何接收
let params = new URLSearchParams();
params.append('infos', this.searchList);
this.axios({
method: 'post',
url: '*****',
data: params,
}).then(function (response) {
}).catch(function (err) {
});
需要了解后端是json接收数据,还是formData接收数据的;看你的情况应该是formData接收;
axios使用formData传输写法: