mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-12 01:12:27 +08:00
chore: bump go version: v1.23.0
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-contrib/sessions/cookie"
|
||||
"github.com/gin-gonic/gin"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// SessionOpts 设置选项
|
||||
@@ -40,7 +40,7 @@ func UserMiddleware() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
cookie, err := c.Cookie("u")
|
||||
if err != nil || cookie == "" {
|
||||
u1 := uuid.NewV4().String()
|
||||
u1 := uuid.New().String()
|
||||
c.SetCookie("u", u1, 86400*730, "/", "", true, true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user