代码小纠错
This commit is contained in:
@@ -127,7 +127,7 @@ func (this *EditController) Get() {
|
||||
id, _ := strconv.Atoi(this.Ctx.Params[":id"])
|
||||
this.Data["Post"] = models.GetBlog(id)
|
||||
this.Layout = "layout.tpl"
|
||||
this.TplNames = "new.tpl"
|
||||
this.TplNames = "edit.tpl"
|
||||
}
|
||||
|
||||
func (this *EditController) Post() {
|
||||
@@ -151,7 +151,9 @@ type DeleteController struct {
|
||||
|
||||
func (this *DeleteController) Get() {
|
||||
id, _ := strconv.Atoi(this.Ctx.Params[":id"])
|
||||
this.Data["Post"] = models.DelBlog(id)
|
||||
blog := models.GetBlog(id)
|
||||
this.Data["Post"] = blog
|
||||
models.DelBlog(blog)
|
||||
this.Ctx.Redirect(302, "/")
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user