跨域
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m59s

This commit is contained in:
2026-05-07 16:28:23 +08:00
parent 573e887ca5
commit 73a3a04204
18 changed files with 634 additions and 894 deletions

View File

@@ -223,6 +223,10 @@ type AuthConfig struct {
// 所有错误统一返回 AppError由全局 ErrorHandler 处理
func Auth(config AuthConfig) fiber.Handler {
return func(c *fiber.Ctx) error {
if c.Method() == fiber.MethodOptions {
return c.SendStatus(fiber.StatusNoContent)
}
// 检查是否跳过认证
path := c.Path()
for _, skipPath := range config.SkipPaths {