fix:修复分享地址和Token生成地址错误的问题

This commit is contained in:
lifei6671
2018-11-15 19:54:25 +08:00
parent 2d3b0ab674
commit f3d8885723
5 changed files with 31 additions and 26 deletions

View File

@@ -533,14 +533,14 @@ func (c *BlogController) Upload() {
if err := attachment.Insert(); err != nil {
os.Remove(filePath)
beego.Error("保存文件附件失败 => ", err)
beego.Error("保存文件附件失败 -> ", err)
c.JsonResult(6006, "文件保存失败")
}
if attachment.HttpPath == "" {
attachment.HttpPath = conf.URLFor("BlogController.Download", ":id", blogId, ":attach_id", attachment.AttachmentId)
attachment.HttpPath = conf.URLForNotHost("BlogController.Download", ":id", blogId, ":attach_id", attachment.AttachmentId)
if err := attachment.Update(); err != nil {
beego.Error("SaveToFile => ", err)
beego.Error("保存文件失败 -> ",attachment.FilePath, err)
c.JsonResult(6005, "保存文件失败")
}
}

View File

@@ -470,7 +470,7 @@ func (c *DocumentController) Upload() {
}
if attachment.HttpPath == "" {
attachment.HttpPath = conf.URLFor("DocumentController.DownloadAttachment", ":key", identify, ":attach_id", attachment.AttachmentId)
attachment.HttpPath = conf.URLForNotHost("DocumentController.DownloadAttachment", ":key", identify, ":attach_id", attachment.AttachmentId)
if err := attachment.Update(); err != nil {
beego.Error("保存文件失败 ->", err)

View File

@@ -413,7 +413,7 @@ func (c *ManagerController) DeleteBook() {
c.JsonResult(6002, "项目不存在")
}
if err != nil {
logs.Error("DeleteBook => ", err)
logs.Error("删除失败 -> ", err)
c.JsonResult(6003, "删除失败")
}
c.JsonResult(0, "ok")