phone:$(".phone").val(),
count:count,
type:'0'
};
$.ajax({
url: url,
type: "POST",//提交的方式
dataType: "json",
data: JSON.stringify(data),
contentType:"application/json;charset=utf-8",
success: function(msg) {
}
})
后台:
@RequestMapping("/login/getmessagecode")
public @ResponseBody JsonMessage getMessageCode(@RequestBody String data) {
Long time=0L;
try {
JSONObject obj = JSONObject.parseObject(data);
String phone = obj.getString("phone");
int count = Integer.valueOf(obj.getString("count"));
String type = obj.getString("type");
..........
}
}