perf: 创建项目时增加选择编辑器功能

This commit is contained in:
zhanzhenping
2024-07-05 17:19:02 +08:00
parent 2b1be9a751
commit 58bac86d1f
2 changed files with 23 additions and 3 deletions

View File

@@ -122,7 +122,7 @@ func (c *BookController) Setting() {
if book.PrivateToken != "" {
book.PrivateToken = conf.URLFor("DocumentController.Index", ":key", book.Identify, "token", book.PrivateToken)
}
fmt.Println("book.PrintState", book.PrintState)
c.Data["Model"] = book
}
@@ -463,6 +463,7 @@ func (c *BookController) Create() {
description := strings.TrimSpace(c.GetString("description", ""))
privatelyOwned, _ := strconv.Atoi(c.GetString("privately_owned"))
commentStatus := c.GetString("comment_status")
editor := c.GetString("editor")
itemId, _ := c.GetInt("itemId")
if bookName == "" {
@@ -529,6 +530,7 @@ func (c *BookController) Create() {
book.CommentCount = 0
book.PrivatelyOwned = privatelyOwned
book.CommentStatus = commentStatus
book.Identify = identify
book.DocCount = 0
book.MemberId = c.Member.MemberId
@@ -538,8 +540,7 @@ func (c *BookController) Create() {
book.IsDownload = 1
book.AutoRelease = 0
book.ItemId = itemId
book.Editor = "markdown"
book.Editor = editor
book.Theme = "default"
if err := book.Insert(c.Lang); err != nil {