状态码
This commit is contained in:
parent
aaa2b4baf3
commit
999e623b82
|
@ -3,6 +3,7 @@ package actions
|
||||||
import (
|
import (
|
||||||
"github.com/gin-contrib/sessions"
|
"github.com/gin-contrib/sessions"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,7 +14,7 @@ func Login(c *gin.Context) {
|
||||||
ref = "/"
|
ref = "/"
|
||||||
}
|
}
|
||||||
if password == "" || strings.Replace(password, " ", "", -1) == "" {
|
if password == "" || strings.Replace(password, " ", "", -1) == "" {
|
||||||
c.Redirect(304, ref)
|
c.Redirect(http.StatusFound, ref)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s := sessions.Default(c)
|
s := sessions.Default(c)
|
||||||
|
@ -23,5 +24,5 @@ func Login(c *gin.Context) {
|
||||||
c.Error(err)
|
c.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.Redirect(302, ref)
|
c.Redirect(http.StatusFound, ref)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user