mirror of
https://github.com/eiblog/eiblog.git
synced 2026-03-01 00:34:58 +08:00
btn submit pointer
This commit is contained in:
1
front.go
1
front.go
@@ -32,7 +32,6 @@ func Filter() gin.HandlerFunc {
|
|||||||
func UserCookie(c *gin.Context) {
|
func UserCookie(c *gin.Context) {
|
||||||
cookie, err := c.Request.Cookie("u")
|
cookie, err := c.Request.Cookie("u")
|
||||||
if err != nil || cookie.Value == "" {
|
if err != nil || cookie.Value == "" {
|
||||||
// TODO cookie操作
|
|
||||||
b := []byte(c.ClientIP() + time.Now().String())
|
b := []byte(c.ClientIP() + time.Now().String())
|
||||||
c.SetCookie("u", fmt.Sprintf("%x", SHA1(b)), 86400*999, "/", "", true, true)
|
c.SetCookie("u", fmt.Sprintf("%x", SHA1(b)), 86400*999, "/", "", true, true)
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user