fix: 跳过响应包装

This commit is contained in:
fuzhongyun 2026-01-26 09:23:53 +08:00
parent 498d165915
commit 855156374e
3 changed files with 12 additions and 0 deletions

View File

@ -28,6 +28,10 @@ func (ft *FlexibleType) UnmarshalJSON(data []byte) error {
}
func (ft FlexibleType) Int() int {
if ft == "" {
return 0
}
i, _ := strconv.Atoi(string(ft))
return i
}

View File

@ -158,6 +158,12 @@ func registerCommon(c *fiber.Ctx, err error) error {
}
var data interface{}
json.Unmarshal(c.Response().Body(), &data)
// 检查是否需要跳过响应包装
if c.Locals("skip_response_wrap") == true {
return c.JSON(data)
}
return c.JSON(fiber.Map{
"data": data,
"message": errors.Success.Error(),

View File

@ -606,6 +606,8 @@ func (s *CallbackService) CallbackDingtalkCard(c *fiber.Ctx) error {
}
}
// 跳过响应包装
c.Locals("skip_response_wrap", true)
return c.JSON(resp)
}