ajax 传参问题
后端domian CxffExamRecord 包含一个List
CxffExamRecord 可以正常接数据,但是List接不到数据,CxffExamRecordChild对象一直是空
前端怎么写 才能让和后端正常接数据
//CxffExamRecord
/** 考试记录子信息 */
private List<CxffExamRecordChild> cxffExamRecordChildList;
//CxffExamRecordChild
/** 试题id */
@Excel(name = "试题id")
private String stid;
/** 题库id */
@Excel(name = "题库id")
private String tkid;
/** 用户ID */
@Excel(name = "用户ID")
private String userid;
/** 用户答案 */
@Excel(name = "用户答案")
private String uesranswer;
var cxffExamRecordChildList=[];
var json= [];
json.tkid = tk;
json.userAnswer = userAw;
cxffExamRecordChildList.push(json);
$.ajax({
type: 'POST',
url: "/cxff/record/add",
data: {
stid:stid,
time:useTime,
score:per,
cxffExamRecordChildList:cxffExamRecordChildList
},
error: function (request) {
return request;
},
success: function (res) {
console.log(res);
}
});