Skip to content

Commit ae32378

Browse files
committed
修改接口,完善代码
1 parent 5b76fa2 commit ae32378

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ebook/13.5.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ViewController:
6666
}
6767

6868
func (this *ViewController) Get() {
69-
id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"])
69+
id, _ := strconv.Atoi(this.Ctx.Input.Params(":id"))
7070
this.Data["Post"] = models.GetBlog(id)
7171
this.Layout = "layout.tpl"
7272
this.TplNames = "view.tpl"
@@ -100,7 +100,7 @@ EditController
100100
}
101101

102102
func (this *EditController) Get() {
103-
id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"])
103+
id, _ := strconv.Atoi(this.Ctx.Input.Params(":id"))
104104
this.Data["Post"] = models.GetBlog(id)
105105
this.Layout = "layout.tpl"
106106
this.TplNames = "new.tpl"
@@ -124,7 +124,7 @@ DeleteController
124124
}
125125

126126
func (this *DeleteController) Get() {
127-
id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"])
127+
id, _ := strconv.Atoi(this.Ctx.Input.Params(":id"))
128128
blog := GetBlog(id int)
129129
this.Data["Post"] = blog
130130
models.DelBlog(blog)

0 commit comments

Comments
 (0)