From 0820397f100c1897c2a7d4f4f4517a654c55a290 Mon Sep 17 00:00:00 2001 From: Minho Date: Mon, 29 Jan 2018 16:22:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BAPDF?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- converter/converter.go | 7 +++++-- models/book_result.go | 6 +++--- views/document/markdown_edit_template.tpl | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/converter/converter.go b/converter/converter.go index 020450f0..375ab80b 100644 --- a/converter/converter.go +++ b/converter/converter.go @@ -137,19 +137,22 @@ func (this *Converter) Convert() (err error) { case "epub": if err = this.convertToEpub(); err != nil { errs = append(errs, err.Error()) + fmt.Println("转换EPUB文档失败:" + err.Error()) } case "mobi": if err = this.convertToMobi(); err != nil { errs = append(errs, err.Error()) + fmt.Println("转换MOBI文档失败:" + err.Error()) } case "pdf": if err = this.convertToPdf(); err != nil { - fmt.Println(err) + fmt.Println("转换PDF文档失败:" + err.Error()) errs = append(errs, err.Error()) + } case "docx": if err = this.convertToDocx(); err != nil { - fmt.Println(err) + fmt.Println("转换WORD文档失败:" + err.Error()) errs = append(errs, err.Error()) } } diff --git a/models/book_result.go b/models/book_result.go index 3a457bdd..30e37de2 100644 --- a/models/book_result.go +++ b/models/book_result.go @@ -199,7 +199,7 @@ func (m *BookResult) Converter(sessionId string) (ConvertBookResult, error) { defer func(p string) { os.RemoveAll(p) }(tempOutputPath) - + if utils.FileExists(pdfpath) && utils.FileExists(epubpath) && utils.FileExists(mobipath) && utils.FileExists(docxpath) { convertBookResult.EpubPath = epubpath convertBookResult.MobiPath = mobipath @@ -245,8 +245,8 @@ func (m *BookResult) Converter(sessionId string) (ConvertBookResult, error) { Cover: m.Cover, Timestamp: time.Now().Format("2006-01-02 15:04:05"), Description: string(blackfriday.MarkdownBasic([]byte(m.Description))), - Footer: "

本文档使用 MinDoc 构建 - _PAGENUM_ -

", - Header: "

_SECTION_

", + Footer: "\"

本文档使用 MinDoc 构建 - _PAGENUM_ -

\"", + Header: "\"

_SECTION_

\"", Identifier: "", Language: "zh-CN", Creator: m.CreateName, diff --git a/views/document/markdown_edit_template.tpl b/views/document/markdown_edit_template.tpl index 9665cf84..5e8c5c2f 100644 --- a/views/document/markdown_edit_template.tpl +++ b/views/document/markdown_edit_template.tpl @@ -41,7 +41,7 @@
-
+
@@ -103,7 +103,7 @@
-
+