mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-24 05:03:45 +08:00
1、实现文章列表、设置、编辑功能
2、实现文章附件功能
This commit is contained in:
@@ -657,17 +657,19 @@ func (c *ManagerController) AttachDetailed() {
|
||||
//删除附件.
|
||||
func (c *ManagerController) AttachDelete() {
|
||||
c.Prepare()
|
||||
attach_id, _ := c.GetInt("attach_id")
|
||||
attachId, _ := c.GetInt("attach_id")
|
||||
|
||||
if attach_id <= 0 {
|
||||
if attachId <= 0 {
|
||||
c.Abort("404")
|
||||
}
|
||||
attach, err := models.NewAttachment().Find(attach_id)
|
||||
attach, err := models.NewAttachment().Find(attachId)
|
||||
|
||||
if err != nil {
|
||||
beego.Error("AttachDelete => ", err)
|
||||
c.JsonResult(6001, err.Error())
|
||||
}
|
||||
attach.FilePath = filepath.Join(conf.WorkingDirectory,attach.FilePath)
|
||||
|
||||
if err := attach.Delete(); err != nil {
|
||||
beego.Error("AttachDelete => ", err)
|
||||
c.JsonResult(6002, err.Error())
|
||||
|
Reference in New Issue
Block a user