Sfoglia il codice sorgente

basicfunction.get_data

jason.lu 6 anni fa
parent
commit
d206165116
1 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 6 2
      sourcecode/h5app/vue/src/connector/basic-service.js

+ 6 - 2
sourcecode/h5app/vue/src/connector/basic-service.js

@@ -122,8 +122,12 @@ var BasicFunction = new (function () {
     this.get_data = function (url, callback, data, onescope) {
         console.log('calling get_data()');
         let jsonData = data;
-        if(typeof data != "string"){
-            jsonData = JSON.stringify(jsonData);
+        if(typeof data !== "string"){
+            if(data.toString().indexOf("FormData") !== -1){
+                jsonData = data;
+            }else {
+                jsonData = JSON.stringify(jsonData);
+            }
         }
         BasicFunction.Queue.list.push({url: url, callback: callback, gid: -1, data: jsonData, scope: onescope});
     };