fix: 还原skip_response_wrap

This commit is contained in:
fuzhongyun 2026-02-05 14:40:22 +08:00
parent cdac506f56
commit 118ea34330
1 changed files with 6 additions and 0 deletions

View File

@ -192,6 +192,12 @@ func registerCommon(c *fiber.Ctx, err error) error {
rawData = json.RawMessage(`"` + strings.ReplaceAll(string(body), `"`, `\"`) + `"`) rawData = json.RawMessage(`"` + strings.ReplaceAll(string(body), `"`, `\"`) + `"`)
} }
} }
// 检查是否需要跳过响应包装
if c.Locals("skip_response_wrap") == true {
return c.JSON(rawData)
}
return c.JSON(fiber.Map{ return c.JSON(fiber.Map{
"data": rawData, "data": rawData,
"message": errors.Success.Error(), "message": errors.Success.Error(),