I encountered a problem today, the front-end AJAX transfer array cannot be received by the back-end interface.
The beginning of ajax is written like this
$.ajax({
type:'POST',
url:'${ctx}/scheduleStudentScoreController/exportScore',
data:{
'ids':scoreIds
},
success:function(result){
console.log(result);
},
error:function(result){
console.log(result);
}
})
I found it online and found that ajax has an attribute
traditional。
This property is defined like this:
Therefore, we can write ajax like this:
$.ajax({
type:'POST',
url:'${ctx}/scheduleStudentScoreController/exportScore',
data:{
'ids':scoreIds
},
traditional: true,
success:function(result){
console.log(result);
},
error:function(result){
console.log(result);
}
})
Related Links