feat: add super admin auth

This commit is contained in:
2026-01-08 10:12:18 +08:00
parent d98f41f1ac
commit 87b32063f6
5 changed files with 345 additions and 19 deletions

View File

@@ -35,5 +35,5 @@ func (c *auth) Login(ctx fiber.Ctx, form *dto.LoginForm) (*dto.LoginResponse, er
// @Produce json
// @Success 200 {object} dto.LoginResponse
func (c *auth) CheckToken(ctx fiber.Ctx) (*dto.LoginResponse, error) {
return services.Super.CheckToken(ctx)
return services.Super.CheckToken(ctx, ctx.Get("Authorization"))
}

View File

@@ -3,8 +3,8 @@ package dto
import "quyun/v2/pkg/consts"
type LoginForm struct {
Phone string `json:"phone"`
OTP string `json:"otp"`
Username string `json:"username"`
Password string `json:"password"`
}
type LoginResponse struct {

View File

@@ -6,6 +6,6 @@ func (r *Routes) Path() string {
func (r *Routes) Middlewares() []any {
return []any{
r.middlewares.Auth,
r.middlewares.SuperAuth,
}
}