superfedder

This commit is contained in:
deepzz0
2016-10-10 00:02:32 +08:00
parent 880f0f0c51
commit 754f7887b7
7 changed files with 11 additions and 10 deletions

11
api.go
View File

@@ -357,7 +357,6 @@ func apiTrashDelete(c *gin.Context) {
return
}
}
c.JSON(http.StatusOK, nil)
responseNotice(c, NOTICE_SUCCESS, "删除成功", "")
}
@@ -386,14 +385,10 @@ func apiTrashRecover(c *gin.Context) {
}
func responseNotice(c *gin.Context, typ, content, hl string) {
domain := setting.Conf.Mode.Domain
if i := strings.Index(domain, ":"); i > -1 {
domain = domain[0:i]
}
if hl != "" {
c.SetCookie("notice_highlight", hl, 86400, "/", domain, true, false)
c.SetCookie("notice_highlight", hl, 86400, "/", "", true, false)
}
c.SetCookie("notice_type", typ, 86400, "/", domain, true, false)
c.SetCookie("notice", fmt.Sprintf("[\"%s\"]", content), 86400, "/", domain, true, false)
c.SetCookie("notice_type", typ, 86400, "/", "", true, false)
c.SetCookie("notice", fmt.Sprintf("[\"%s\"]", content), 86400, "/", "", true, false)
c.Redirect(http.StatusFound, c.Request.Referer())
}