yusuketk 5 лет назад
Родитель
Сommit
3b69e846af
1 измененных файлов с 18 добавлено и 8 удалено
  1. 18 8
      src/client/js/components/Page/PageShareManagement.jsx

+ 18 - 8
src/client/js/components/Page/PageShareManagement.jsx

@@ -32,16 +32,26 @@ const PageShareManagement = (props) => {
     try {
       // TODO GW-3062 現状では pdf ファイル形式の場合空のデータがダウンロードされるので要修正
       const responseType = type === 'pdf' ? 'arraybuffer' : 'json';
-      const data = await appContainer.apiv3Get('/page/export',
-        {
-          pageId,
-          revisionId,
-          type,
-          responseType,
-        });
+      const axios = require('axios').create({
+        headers: {
+          'Content-Type': 'application/pdf',
+        },
+        responseType: 'arraybuffer',
+      });
+
+      const data = await axios.get('/_api/v3/page/export', {
+      // const data = await appContainer.apiv3Get('/page/export',
+        params:
+          {
+            pageId,
+            revisionId,
+            type,
+          },
+      });
+      console.log(data.data);
       const blobType = type === 'pdf' ? 'application/pdf' : 'application/json';
       const blob = new Blob(
-        [data],
+        [data.data],
         { type: blobType },
       );
       const link = document.createElement('a');