Sfoglia il codice sorgente

测试阶段 --下载7

sophieChenyx 6 anni fa
parent
commit
d0bc81d474
1 ha cambiato i file con 6 aggiunte e 8 eliminazioni
  1. 6 8
      src/utils/request.js

+ 6 - 8
src/utils/request.js

@@ -79,10 +79,10 @@ export default function request(url, options) {
     } 
   }
   // download excel
-  // if ( newOptions.DOWNLOAD ) {
-  //   console.log('download request');
-  //   delete newOptions.DOWNLOAD;
-  // } 
+  if ( newOptions.DOWNLOAD ) {
+    console.log('download request');
+    delete newOptions.DOWNLOAD;
+  } 
 
   console.log('>>>>>>>>>newOptions',newOptions)
   return fetch(url, newOptions)
@@ -91,10 +91,8 @@ export default function request(url, options) {
       if (response.status === 204) {
         return response.text();
       }
-      if ( newOptions.DOWNLOAD ) {
-        delete newOptions.DOWNLOAD;
-        return window.open(response.url);
-      } 
+      console.log('fetch 中获取的response',response)
+      
       return response.json();
 
     })