fix post page

This commit is contained in:
deepzz0
2016-10-19 22:16:58 +08:00
parent 2f52a53ff3
commit 773378682b
5 changed files with 21 additions and 29 deletions

15
back.go
View File

@@ -97,15 +97,18 @@ type T struct {
func HandlePost(c *gin.Context) {
h := GetBack()
id, err := strconv.Atoi(c.Query("cid"))
if artc := QueryArticle(int32(id)); err == nil && id > 0 && artc != nil {
h["Title"] = "编辑文章 | " + Ei.BTitle
h["Edit"] = artc
} else {
if err == nil && id > 0 {
artc := QueryArticle(int32(id))
if artc != nil {
h["Title"] = "编辑文章 | " + Ei.BTitle
h["Edit"] = artc
}
}
if h["Title"] == "" {
h["Title"] = "撰写文章 | " + Ei.BTitle
}
h["Post"] = true
h["Path"] = c.Request.URL.Path
h["Title"] = "撰写文章 | " + Ei.BTitle
h["Domain"] = setting.Conf.Mode.Domain
h["Series"] = Ei.Series
var tags []T
@@ -126,7 +129,7 @@ func HandleDraftDelete(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"error": "删除错误"})
return
}
c.JSON(http.StatusOK, nil)
c.Redirect(http.StatusFound, "/admin/write-post")
}
// 文章管理==>Manage