sophieChenyx 6 gadi atpakaļ
vecāks
revīzija
52c5062062

+ 1 - 2
src/routes/Dashboard/Accounts/AccountsCampus.js

@@ -23,11 +23,10 @@ export default class CampusAccountsPage extends Component {
     this.props.dispatch({
       type: 'accounts/fetchCampusList',
       payload: { ...this.state.Queryers }
-    })
+    });
   }
 
   handleDownloadOperation = () => {
-    console.log('press download');
     this.props.dispatch({
       type: 'accounts/fetchCampusExcel',
       payload: 'download',

+ 1 - 19
src/utils/request.js

@@ -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) => {