|
@@ -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});
|
|
|
};
|