浏览代码

Merge branch 'master' of https://matrix.niimei.com/szustar/szugift-fe

StephenArk30 6 年之前
父节点
当前提交
cdee539ca2
共有 1 个文件被更改,包括 15 次插入4 次删除
  1. 15 4
      sourcecode/h5app/vue/src/connector/basic-service.js

+ 15 - 4
sourcecode/h5app/vue/src/connector/basic-service.js

@@ -59,11 +59,18 @@ var BasicFunction = new (function () {
 
 
     this.goajax = function (jqObject) {
+        if(typeof jqObject.data !== "string"){
+            if(jqObject.toString().indexOf("FromData") !== -1) {
+                return fetch(jqObject.url, {
+                    method: 'POST',
+                    body: jqObject.data
+                });
+            }
+        }
         return fetch(jqObject.url, {
             method: 'POST',
             headers: {
-                'Content-Type': 'application/json',
-                //'x-doiby-authenticate' : 'CISICMIEINAOQPMDPWIDNENU'
+                'Content-Type': 'application/json'
             },
             body: jqObject.data
         });
@@ -122,8 +129,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});
     };