diff --git a/src/main/server/convert.ts b/src/main/server/convert.ts index 88248a3c..6417bb8d 100644 --- a/src/main/server/convert.ts +++ b/src/main/server/convert.ts @@ -12,7 +12,7 @@ const convert = async (html: string, type: string) => { const path = os.tmpdir() + `/yn_convert_${new Date().getTime()}.${type}` return new Promise((resolve, reject) => { - const args = ['-f', 'html', '-o', path, '--reference-doc', docxTplPath] + const args = ['--self-contained', '-f', 'html', '-o', path, '--reference-doc', docxTplPath] console.log(binPath, args) const process = spawn(binPath, args) diff --git a/src/main/server/index.ts b/src/main/server/index.ts index 899a2719..e40be624 100644 --- a/src/main/server/index.ts +++ b/src/main/server/index.ts @@ -150,7 +150,7 @@ const convertFile = async (ctx: any, next: any) => { const html = ctx.request.body.html const type = ctx.request.body.type - ctx.type = mime.getType(`file.${type}`) + ctx.set('content-type', 'application/octet-stream') ctx.body = await convert(html, type) } else { await next() diff --git a/src/renderer/components/ExportPanel.vue b/src/renderer/components/ExportPanel.vue new file mode 100644 index 00000000..a7f7ecda --- /dev/null +++ b/src/renderer/components/ExportPanel.vue @@ -0,0 +1,262 @@ +