Since the background is defined interfaces, you must change the form submitted content into json string, so write a value converted to the form in the form of a string json function.
Under the prerequisite should be introduced distal JQuery, refer to the following:
/** 表单序列化成json字符串的方法 */
function form2JsonString(formId) {
var paramArray = $('#' + formId).serializeArray();
/*请求参数转json对象*/
var jsonObj={};
$(paramArray).each(function(){
jsonObj[this.name]=this.value;
});
// json对象再转换成json字符串
return JSON.stringify(jsonObj);
}
Second, the use of
Third, resolve backstage
proApprovalStage = JSON.parseObject(JSON.parse(jsonStr).toString(),ProApprovalStage.class);