lsc 3 minggu lalu
induk
melakukan
517d4f7f4d
1 mengubah file dengan 10 tambahan dan 0 penghapusan
  1. 10 0
      pbl.js

+ 10 - 0
pbl.js

@@ -926,6 +926,16 @@ router.route("/getGraphs").all(async (req, res, next) => {
             
             //将要提取的文件添加到临时文件夹
             let documentids = decodeURIComponent(req.body[0].fileids).split(",");
+
+            await Promise.all(documentids.map(documentid =>
+                client.documents.extract({
+                    id: documentid,
+                    runWithOrchestration: false
+                }).catch(error => {
+                    console.error("提取文件发生错误:", error);
+                })
+            ));
+            
             // 使用 Promise.all 确保所有添加操作都被执行
             await Promise.all(documentids.map(documentid =>
                 client.collections.addDocument({