登录页尝试使用csrf校验

This commit is contained in:
GoEdgeLab
2020-10-25 11:22:11 +08:00
parent 5345888280
commit 08af418665
11 changed files with 236 additions and 1 deletions

View File

@@ -15,7 +15,9 @@ import (
"time"
)
type IndexAction actions.Action
type IndexAction struct {
actionutils.ParentAction
}
// 首页(登录页)
@@ -56,6 +58,7 @@ func (this *IndexAction) RunPost(params struct {
Remember bool
Must *actions.Must
Auth *helpers.UserShouldAuth
CSRF *actionutils.CSRF
}) {
params.Must.
Field("username", params.Username).