|
@@ -58,7 +58,6 @@ export default function request(url, options) {
|
|
|
credentials: 'include',
|
|
|
};
|
|
|
const newOptions = { ...defaultOptions, ...options };
|
|
|
- console.log('>>>>>>>>>> 01newOptions',newOptions)
|
|
|
if (newOptions.method === 'POST' || newOptions.method === 'PUT' || newOptions.method === 'DELETE') {
|
|
|
if (!(newOptions.body instanceof FormData)) {
|
|
|
newOptions.headers = {
|
|
@@ -76,32 +75,15 @@ export default function request(url, options) {
|
|
|
'Content-Type': 'multipart/form-data',
|
|
|
...newOptions.headers,
|
|
|
};
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
- // download excel
|
|
|
- if ( newOptions.DOWNLOAD ) {
|
|
|
- console.log('download request');
|
|
|
- delete newOptions.DOWNLOAD;
|
|
|
- }
|
|
|
-
|
|
|
- console.log('>>>>>>>>>newOptions',newOptions)
|
|
|
return fetch(url, newOptions)
|
|
|
.then(checkHttpStatus)
|
|
|
.then((response) => {
|
|
|
if (response.status === 204) {
|
|
|
return response.text();
|
|
|
}
|
|
|
-
|
|
|
- if( response && response.ok && response.url ) {
|
|
|
- // 获取的参数为Stream 形式
|
|
|
- var blob = response.body;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- console.log('fetch 中获取的response',response)
|
|
|
-
|
|
|
return response.json();
|
|
|
-
|
|
|
})
|
|
|
.then(checkContentStatus)
|
|
|
.catch((e) => {
|