示例#1
0
func (this *TopicController) Delete() {
	if !checkAccount(this.Ctx) {
		this.Redirect("/login", 302)
		return
	}

	err := models.DeleteTopic(this.Ctx.Input.Param("0"))
	if err != nil {
		beego.Error(err)
	}
	this.Redirect("/", 302)
}
示例#2
0
文件: topic.go 项目: GuoBug/beeblog
func (this *TopicController) Del() {
	if !checkAccount(this.Ctx) {
		beego.Error("delete topic")
		this.Redirect("/login", 302)
		return
	}
	id := this.Input().Get("id")
	err := models.DeleteTopic(id)
	if err != nil {
		beego.Error(err)
	}
	this.Redirect("/topic", 302)
}