|
@@ -137,14 +137,16 @@
|
|
// 请求类型,可以是 GET、POST、PUT、DELETE 等
|
|
// 请求类型,可以是 GET、POST、PUT、DELETE 等
|
|
type: "POST",
|
|
type: "POST",
|
|
// 发送到服务器的数据,格式为键值对
|
|
// 发送到服务器的数据,格式为键值对
|
|
- data: {
|
|
|
|
|
|
+ data: JSON.stringify({
|
|
study_name: study_name,
|
|
study_name: study_name,
|
|
study_ph: study_ph,
|
|
study_ph: study_ph,
|
|
study_sfz: study_sfz,
|
|
study_sfz: study_sfz,
|
|
study_eb: study_eb
|
|
study_eb: study_eb
|
|
- },
|
|
|
|
|
|
+ }),
|
|
// 设置请求和响应的格式,常见的有 "json"、"html"、"xml" 等
|
|
// 设置请求和响应的格式,常见的有 "json"、"html"、"xml" 等
|
|
dataType: "json",
|
|
dataType: "json",
|
|
|
|
+ // 设置请求头,指定请求体为 JSON 格式
|
|
|
|
+ contentType: "application/json",
|
|
// 请求成功时的回调函数
|
|
// 请求成功时的回调函数
|
|
success: function (response) {
|
|
success: function (response) {
|
|
if (response.success) {
|
|
if (response.success) {
|