mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-19 01:58:00 +08:00
feat:1、实现空节点功能,当文档标记为空目录时不加载内容页无法编辑内容
2、实现HTTP接口方式登录, 3、优化markdown编辑器部分功能
This commit is contained in:
@@ -107,7 +107,7 @@ func (c *AccountController) Login() {
|
||||
member, err := models.NewMember().Login(account, password)
|
||||
if err == nil {
|
||||
member.LastLoginTime = time.Now()
|
||||
member.Update()
|
||||
_ = member.Update("last_login_time")
|
||||
|
||||
c.SetMember(*member)
|
||||
|
||||
|
@@ -753,14 +753,7 @@ func (c *BookController) Release() {
|
||||
}
|
||||
bookId = book.BookId
|
||||
}
|
||||
go func(identify string) {
|
||||
models.NewBook().ReleaseContent(bookId)
|
||||
|
||||
//当文档发布后,需要删除已缓存的转换项目
|
||||
outputPath := filepath.Join(conf.GetExportOutputPath(), strconv.Itoa(bookId))
|
||||
_ = os.RemoveAll(outputPath)
|
||||
|
||||
}(identify)
|
||||
go models.NewBook().ReleaseContent(bookId)
|
||||
|
||||
c.JsonResult(0, "发布任务已推送到任务队列,稍后将在后台执行。")
|
||||
}
|
||||
|
@@ -203,6 +203,7 @@ func (c *DocumentController) Edit() {
|
||||
beego.Error("查询项目时出错 -> ", err)
|
||||
c.ShowErrorPage(500, "查询项目时出错")
|
||||
}
|
||||
return
|
||||
}
|
||||
if bookResult.RoleId == conf.BookObserver {
|
||||
c.JsonResult(6002, "项目不存在或权限不足")
|
||||
@@ -318,6 +319,8 @@ func (c *DocumentController) Create() {
|
||||
|
||||
if isOpen == 1 {
|
||||
document.IsOpen = 1
|
||||
} else if isOpen == 2 {
|
||||
document.IsOpen = 2
|
||||
} else {
|
||||
document.IsOpen = 0
|
||||
}
|
||||
@@ -742,6 +745,7 @@ func (c *DocumentController) Content() {
|
||||
|
||||
doc.Version = time.Now().Unix()
|
||||
doc.Content = content
|
||||
doc.ModifyAt = c.Member.MemberId
|
||||
|
||||
if err := doc.InsertOrUpdate(); err != nil {
|
||||
beego.Error("InsertOrUpdate => ", err)
|
||||
@@ -775,6 +779,7 @@ func (c *DocumentController) Content() {
|
||||
doc, err := models.NewDocument().Find(docId)
|
||||
if err != nil {
|
||||
c.JsonResult(6003, "文档不存在")
|
||||
return
|
||||
}
|
||||
|
||||
attach, err := models.NewAttachment().FindListByDocumentId(doc.DocumentId)
|
||||
|
Reference in New Issue
Block a user