Skip to content

Commit 0498559

Browse files
authoredSep 28, 2017
Update 04.1.md
登陆改成了登录
1 parent af90cc4 commit 0498559

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎zh/04.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<form action="/login" method="post">
1212
用户名:<input type="text" name="username">
1313
密码:<input type="password" name="password">
14-
<input type="submit" value="登陆">
14+
<input type="submit" value="登录">
1515
</form>
1616
</body>
1717
</html>
1818
```
19-
上面递交表单到服务器的`/login`当用户输入信息点击登陆之后,会跳转到服务器的路由`login`里面,我们首先要判断这个是什么方式传递过来,POST还是GET呢?
19+
上面递交表单到服务器的`/login`当用户输入信息点击登录之后,会跳转到服务器的路由`login`里面,我们首先要判断这个是什么方式传递过来,POST还是GET呢?
2020

2121
http包里面有一个很简单的方式就可以获取,我们在前面web的例子的基础上来看看怎么处理login页面的form数据
2222
```Go
@@ -51,7 +51,7 @@ func login(w http.ResponseWriter, r *http.Request) {
5151
t, _ := template.ParseFiles("login.gtpl")
5252
log.Println(t.Execute(w, nil))
5353
} else {
54-
//请求的是登陆数据,那么执行登陆的逻辑判断
54+
//请求的是登录数据,那么执行登录的逻辑判断
5555
fmt.Println("username:", r.Form["username"])
5656
fmt.Println("password:", r.Form["password"])
5757
}

0 commit comments

Comments
 (0)
Please sign in to comment.