diff --git a/server/middleware/jwt.go b/server/middleware/jwt.go index 7715ed9c79..f4c0296258 100644 --- a/server/middleware/jwt.go +++ b/server/middleware/jwt.go @@ -2,11 +2,12 @@ package middleware import ( "errors" + "strconv" + "time" + "github.com/flipped-aurora/gin-vue-admin/server/global" "github.com/flipped-aurora/gin-vue-admin/server/utils" "github.com/golang-jwt/jwt/v5" - "strconv" - "time" "github.com/flipped-aurora/gin-vue-admin/server/model/common/response" "github.com/gin-gonic/gin" @@ -59,7 +60,7 @@ func JWTAuth() gin.HandlerFunc { newClaims, _ := j.ParseToken(newToken) c.Header("new-token", newToken) c.Header("new-expires-at", strconv.FormatInt(newClaims.ExpiresAt.Unix(), 10)) - utils.SetToken(c, newToken, int(dr.Seconds())) + utils.SetToken(c, newToken, int(dr.Seconds()/60)) if global.GVA_CONFIG.System.UseMultipoint { // 记录新的活跃jwt _ = utils.SetRedisJWT(newToken, newClaims.Username)