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