From 1ecdb10303ca258f07ed3eb2ad54bdae912d5789 Mon Sep 17 00:00:00 2001 From: lifei6671 Date: Mon, 4 Mar 2019 14:22:48 +0800 Subject: [PATCH] =?UTF-8?q?style:=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/AccountController.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/controllers/AccountController.go b/controllers/AccountController.go index b3b83844..856ad0c7 100644 --- a/controllers/AccountController.go +++ b/controllers/AccountController.go @@ -1,15 +1,15 @@ package controllers import ( + "net/url" "regexp" "strings" "time" - "net/url" - "github.com/lifei6671/mindoc/mail" "github.com/astaxie/beego" "github.com/lifei6671/gocaptcha" "github.com/lifei6671/mindoc/conf" + "github.com/lifei6671/mindoc/mail" "github.com/lifei6671/mindoc/models" "github.com/lifei6671/mindoc/utils" "html/template" @@ -31,7 +31,7 @@ func (c *AccountController) referer() string { func (c *AccountController) Prepare() { c.BaseController.Prepare() c.EnableXSRF = true - c.Data["xsrfdata"]=template.HTML(c.XSRFFormHTML()) + c.Data["xsrfdata"] = template.HTML(c.XSRFFormHTML()) if c.Ctx.Input.IsPost() { token := c.Ctx.Input.Query("_xsrf") if token == "" { @@ -42,7 +42,7 @@ func (c *AccountController) Prepare() { } if token == "" { if c.IsAjax() { - c.JsonResult(403,"非法请求") + c.JsonResult(403, "非法请求") } else { c.ShowErrorPage(403, "非法请求") } @@ -50,13 +50,14 @@ func (c *AccountController) Prepare() { xsrfToken := c.XSRFToken() if xsrfToken != token { if c.IsAjax() { - c.JsonResult(403,"非法请求") + c.JsonResult(403, "非法请求") } else { c.ShowErrorPage(403, "非法请求") } } } } + // Login 用户登录 func (c *AccountController) Login() { c.Prepare()