|
|
@@ -131,26 +131,26 @@
|
|
|
|
|
|
var form = new FormData();
|
|
|
form = JSON.stringify(params.data);
|
|
|
- var ContentType = 'application/json';
|
|
|
+ var ContentType = 'application/x-www-form-urlencoded';
|
|
|
+ // var ContentType = 'application/json';
|
|
|
let header = {
|
|
|
- // "Content-Type": "application/json",
|
|
|
"Content-Type": ContentType,
|
|
|
"Authorization":'Bearer ' + getToken(),
|
|
|
}
|
|
|
|
|
|
let isFormData = (typeof FormData !== 'undefined') && (params['data'] instanceof FormData);
|
|
|
|
|
|
- if (isFormData) {
|
|
|
- delete header['Content-Type'];
|
|
|
- form = data;
|
|
|
- }
|
|
|
+ // if (isFormData) {
|
|
|
+ // delete header['Content-Type'];
|
|
|
+ // form = data;
|
|
|
+ // }
|
|
|
|
|
|
let headers = new Headers(header);
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
fetch(url,{
|
|
|
method: method,
|
|
|
- body: form,
|
|
|
+ body: params.data,
|
|
|
headers: headers
|
|
|
}).then(function (response) {
|
|
|
return response.json();
|