From 999e623b8224842ba9a1eb5d3fc09b1d9dbb309e Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 19 Sep 2022 22:25:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actions/login.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/actions/login.go b/actions/login.go index 5d192af..84891c6 100644 --- a/actions/login.go +++ b/actions/login.go @@ -3,6 +3,7 @@ package actions import ( "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" + "net/http" "strings" ) @@ -13,7 +14,7 @@ func Login(c *gin.Context) { ref = "/" } if password == "" || strings.Replace(password, " ", "", -1) == "" { - c.Redirect(304, ref) + c.Redirect(http.StatusFound, ref) return } s := sessions.Default(c) @@ -23,5 +24,5 @@ func Login(c *gin.Context) { c.Error(err) return } - c.Redirect(302, ref) + c.Redirect(http.StatusFound, ref) }