ソースを参照

Update bootstrap-table.js

用application/json且post提交时必须先用JSON.stringify序列化,不然接收时反序列化数据会出错
ltcszk 11 年 前
コミット
621ba04503
1 ファイル変更1 行追加1 行削除
  1. 1 1
      src/bootstrap-table.js

+ 1 - 1
src/bootstrap-table.js

@@ -1217,7 +1217,7 @@
         $.ajax($.extend({}, calculateObjectValue(null, this.options.ajaxOptions), {
         $.ajax($.extend({}, calculateObjectValue(null, this.options.ajaxOptions), {
             type: this.options.method,
             type: this.options.method,
             url: this.options.url,
             url: this.options.url,
-            data: data,
+            data: ("application/json" == this.options.contentType && this.options.method == "post") ? JSON.stringify(data): data,
             cache: this.options.cache,
             cache: this.options.cache,
             contentType: this.options.contentType,
             contentType: this.options.contentType,
             dataType: this.options.dataType,
             dataType: this.options.dataType,