feat: update

This commit is contained in:
Rogee
2025-05-23 20:07:34 +08:00
parent 9b38699764
commit 57cb0a750b
53 changed files with 741 additions and 982 deletions

View File

@@ -5,7 +5,7 @@ import (
"strings"
"time"
"quyun/app/models"
"quyun/app/model"
"quyun/pkg/utils"
"github.com/gofiber/fiber/v3"
@@ -26,7 +26,7 @@ func (f *Middlewares) Auth(ctx fiber.Ctx) error {
}
if f.app.IsDevMode() && false {
user, err := models.Users.GetByID(ctx.Context(), 1)
user, err := model.UsersModel.GetByID(ctx.Context(), 1)
if err != nil {
return ctx.Send([]byte("User not found"))
}
@@ -66,7 +66,7 @@ func (f *Middlewares) Auth(ctx fiber.Ctx) error {
return ctx.Redirect().To(fullUrl)
}
user, err := models.Users.GetByID(ctx.Context(), jwt.UserID)
user, err := model.UsersModel.GetByID(ctx.Context(), jwt.UserID)
if err != nil {
// remove cookie
ctx.ClearCookie("token")