var param = {};
param.username = username;
$.ajax({
headers : {
"content-Type":"application/json;charset=UTF-8"
},
url : jsDataPath+‘user/save‘,
type : ‘POST‘,
data: JSON.stringify(params),
success : function (res) {
if(res.code==200){
layer.msg(‘添加成功!‘);
layer.close(index);
loadUserData();
}else{
layer.msg(res.message);
}
}
})
后台:
@RequestMapping("/save")
@ResponseBody
public Object save2(@RequestBody SUsers model) {