mirror of https://github.com/mindoc-org/mindoc.git
修复只有第一次导入docx文件有效问题
parent
d43010640b
commit
ade6734779
|
@ -622,6 +622,9 @@ func (c *BookController) Import() {
|
||||||
tempPath = filepath.Join(tempPath, moreFile.Filename)
|
tempPath = filepath.Join(tempPath, moreFile.Filename)
|
||||||
|
|
||||||
err = c.SaveToFile("import-file", tempPath)
|
err = c.SaveToFile("import-file", tempPath)
|
||||||
|
if err != nil {
|
||||||
|
c.JsonResult(6004, i18n.Tr(c.Lang, "message.upload_failed"))
|
||||||
|
}
|
||||||
|
|
||||||
book := models.NewBook()
|
book := models.NewBook()
|
||||||
|
|
||||||
|
|
|
@ -1038,8 +1038,6 @@ func (book *Book) ImportWordBook(docxPath string, lang string) (err error) {
|
||||||
|
|
||||||
doc.DocumentName = strings.TrimSpace(docName)
|
doc.DocumentName = strings.TrimSpace(docName)
|
||||||
|
|
||||||
doc.DocumentId = book.MemberId
|
|
||||||
|
|
||||||
if err := doc.InsertOrUpdate("document_name", "book_id", "markdown", "content"); err != nil {
|
if err := doc.InsertOrUpdate("document_name", "book_id", "markdown", "content"); err != nil {
|
||||||
logs.Error(doc.DocumentId, err)
|
logs.Error(doc.DocumentId, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue