mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
实现导入Markdown
This commit is contained in:
@@ -473,7 +473,7 @@ func (c *BookController) Create() {
|
||||
}
|
||||
}
|
||||
|
||||
if books, _ := book.FindByField("identify", identify); len(books) > 0 {
|
||||
if books, _ := book.FindByField("identify", identify,"book_id"); len(books) > 0 {
|
||||
c.JsonResult(6006, "项目标识已存在")
|
||||
}
|
||||
|
||||
@@ -543,6 +543,10 @@ func (c *BookController) Import() {
|
||||
c.JsonResult(6004, "不支持的文件类型")
|
||||
}
|
||||
|
||||
if books, _ := models.NewBook().FindByField("identify", identify,"book_id"); len(books) > 0 {
|
||||
c.JsonResult(6006, "项目标识已存在")
|
||||
}
|
||||
|
||||
tempPath := filepath.Join(os.TempDir(), c.CruSession.SessionID())
|
||||
|
||||
os.MkdirAll(tempPath, 0766)
|
||||
@@ -676,7 +680,7 @@ func (c *BookController) Release() {
|
||||
bookId = book.BookId
|
||||
}
|
||||
go func(identify string) {
|
||||
models.NewDocument().ReleaseContent(bookId)
|
||||
models.NewBook().ReleaseContent(bookId)
|
||||
|
||||
//当文档发布后,需要删除已缓存的转换项目
|
||||
outputPath := filepath.Join(beego.AppConfig.DefaultString("book_output_path", "cache"), strconv.Itoa(bookId))
|
||||
|
||||
@@ -766,7 +766,7 @@ func (c *DocumentController) Content() {
|
||||
//如果启用了自动发布
|
||||
if autoRelease {
|
||||
go func(identify string) {
|
||||
models.NewDocument().ReleaseContent(bookId)
|
||||
models.NewBook().ReleaseContent(bookId)
|
||||
|
||||
}(identify)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user