mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-06 05:30:05 +00:00
🎉 init swaggo
This commit is contained in:
@@ -3,7 +3,6 @@ package mygin
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -43,7 +42,7 @@ func Authorize(opt AuthorizeOption) func(*gin.Context) {
|
||||
if token != "" {
|
||||
var u model.User
|
||||
if err := singleton.DB.Where("token = ?", token).First(&u).Error; err == nil {
|
||||
isLogin = u.TokenExpired.After(time.Now())
|
||||
isLogin = true // u.TokenExpired.After(time.Now())
|
||||
}
|
||||
if isLogin {
|
||||
c.Set(model.CtxKeyAuthorizedUser, &u)
|
||||
|
||||
Reference in New Issue
Block a user