|
@@ -21,16 +21,17 @@ export async function commonFetch({ url = '', method = 'POST' , params = {}, bas
|
|
|
if(url.includes('http')){
|
|
|
_url = url
|
|
|
}
|
|
|
+ let bodyObj = {
|
|
|
+ "baseInfo": baseInfo,
|
|
|
+ "params": params
|
|
|
+ };
|
|
|
fetch(_url, {
|
|
|
method: method, // or 'PUT'
|
|
|
cache: 'no-cache',
|
|
|
headers: {
|
|
|
'Content-Type': 'application/json',
|
|
|
},
|
|
|
- body: JSON.stringify({
|
|
|
- "baseInfo": baseInfo,
|
|
|
- "params": params
|
|
|
- }),
|
|
|
+ body: JSON.stringify(bodyObj),
|
|
|
})
|
|
|
.then(response => response.json())
|
|
|
.then(data => {
|
|
@@ -60,7 +61,7 @@ export async function commonFetch({ url = '', method = 'POST' , params = {}, bas
|
|
|
resolve(data);
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
- reject(error);
|
|
|
+ reject({url: _url, error: error, requestParams: bodyObj});
|
|
|
});
|
|
|
})
|
|
|
}
|