添加运行模式配置,优化调试和生产环境的日志输出
This commit is contained in:
@@ -66,6 +66,11 @@ func Protect(c *fiber.Ctx, types []services.PayloadType, permissions []string) (
|
||||
return nil, fiber.NewError(fiber.StatusForbidden, "没有权限")
|
||||
}
|
||||
|
||||
// 保存到上下文
|
||||
c.Locals("auth", auth)
|
||||
c.Locals("authid", auth.Payload.Id)
|
||||
c.Locals("authtype", auth.Payload.Type.Name())
|
||||
|
||||
return auth, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user