mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
修复BUG
This commit is contained in:
@@ -21,11 +21,11 @@ import (
|
|||||||
"github.com/astaxie/beego/orm"
|
"github.com/astaxie/beego/orm"
|
||||||
"github.com/boombuler/barcode"
|
"github.com/boombuler/barcode"
|
||||||
"github.com/boombuler/barcode/qr"
|
"github.com/boombuler/barcode/qr"
|
||||||
|
"github.com/lifei6671/godoc/commands"
|
||||||
"github.com/lifei6671/godoc/conf"
|
"github.com/lifei6671/godoc/conf"
|
||||||
"github.com/lifei6671/godoc/models"
|
"github.com/lifei6671/godoc/models"
|
||||||
"github.com/lifei6671/godoc/utils"
|
"github.com/lifei6671/godoc/utils"
|
||||||
"github.com/lifei6671/godoc/utils/wkhtmltopdf"
|
"github.com/lifei6671/godoc/utils/wkhtmltopdf"
|
||||||
"github.com/lifei6671/godoc/commands"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
//DocumentController struct.
|
//DocumentController struct.
|
||||||
@@ -546,7 +546,7 @@ func (c *DocumentController) DownloadAttachment() {
|
|||||||
if attachment.BookId != book_id {
|
if attachment.BookId != book_id {
|
||||||
c.Abort("404")
|
c.Abort("404")
|
||||||
}
|
}
|
||||||
c.Ctx.Output.Download(strings.Join(commands.WorkingDirectory,attachment.FilePath), attachment.FileName)
|
c.Ctx.Output.Download(filepath.Join(commands.WorkingDirectory, attachment.FilePath), attachment.FileName)
|
||||||
|
|
||||||
c.StopRun()
|
c.StopRun()
|
||||||
}
|
}
|
||||||
@@ -587,7 +587,7 @@ func (c *DocumentController) RemoveAttachment() {
|
|||||||
beego.Error(err)
|
beego.Error(err)
|
||||||
c.JsonResult(6005, "删除失败")
|
c.JsonResult(6005, "删除失败")
|
||||||
}
|
}
|
||||||
os.Remove(strings.Join(commands.WorkingDirectory,attach.FilePath))
|
os.Remove(filepath.Join(commands.WorkingDirectory, attach.FilePath))
|
||||||
|
|
||||||
c.JsonResult(0, "ok", attach)
|
c.JsonResult(0, "ok", attach)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ package models
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/astaxie/beego"
|
||||||
"github.com/astaxie/beego/orm"
|
"github.com/astaxie/beego/orm"
|
||||||
"github.com/lifei6671/godoc/conf"
|
"github.com/lifei6671/godoc/conf"
|
||||||
"os"
|
|
||||||
"github.com/astaxie/beego"
|
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Attachment struct .
|
// Attachment struct .
|
||||||
|
|||||||
Reference in New Issue
Block a user