feat: 个人中心发布
This commit is contained in:
+2
-2
@@ -5,8 +5,8 @@ import (
|
||||
"sundynix-go/global"
|
||||
"sundynix-go/model/commom/response"
|
||||
"sundynix-go/service"
|
||||
"sundynix-go/utils"
|
||||
"sundynix-go/utils/auth"
|
||||
"sundynix-go/utils/timer"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -48,7 +48,7 @@ func AuthMiddleware() gin.HandlerFunc {
|
||||
}
|
||||
c.Set("claims", claims)
|
||||
if claims.ExpiresAt.Unix()-time.Now().Unix() < claims.BufferTime {
|
||||
dr, _ := utils.ParseDuration(global.Config.JWT.ExpiresTime)
|
||||
dr, _ := timer.ParseDuration(global.Config.JWT.ExpiresTime)
|
||||
claims.ExpiresAt = jwt.NewNumericDate(time.Now().Add(dr))
|
||||
}
|
||||
c.Next()
|
||||
|
||||
Reference in New Issue
Block a user