$.ajax({
//几个参数需要注意一下
type: "POST",//方法类型
contentType: "application/json",
dataType: "json",//预期服务器返回的数据类型
url: "" ,//url
data: {
"phone": $.trim($("[name='phone']").val()),
"type": "Register",
"sendSms": true
},
success: function (result) {
console.log(result);//打印服务端返回的数据(调试用)
if (result.resultCode == 200) {
alert("SUCCESS");
}
},
error : function() {
alert("异常!");
}
});
为什么参数像get提交的一样,后端获取不到数据?