ryanemax преди 7 месеца
родител
ревизия
2b55c0aefa
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      server/lib/docs/index.js

+ 5 - 0
server/lib/docs/index.js

@@ -248,6 +248,11 @@ export function renderDocx(inputDocxPath, outputDocxName, options){
     });
 
     // Render the document (Replace {first_name} by John, {last_name} by Doe, ...)
+    Object.keys(options).forEach(key=>{ // 除去空值
+        if(options[key]==undefined){
+            options[key] = ""
+        }
+    })
     doc.render(options);
 
     // Get the zip document and generate it as a nodebuffer