chore: update swag version & change uuid package

This commit is contained in:
henry.chen
2021-11-13 22:20:48 +08:00
parent a5292027c0
commit f6cb55c00f
9 changed files with 111 additions and 112 deletions

View File

@@ -3,7 +3,7 @@ package mid
import (
"github.com/gin-gonic/gin"
"github.com/gofrs/uuid"
uuid "github.com/satori/go.uuid"
)
// UserMiddleware 用户cookie标记
@@ -11,7 +11,7 @@ func UserMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
cookie, err := c.Cookie("u")
if err != nil || cookie == "" {
u1 := uuid.Must(uuid.NewV4()).String()
u1 := uuid.NewV4().String()
c.SetCookie("u", u1, 86400*730, "/", "", true, true)
}
}