diff --git a/bff/etc/product.pb b/bff/etc/product.pb index cff1cd9..be7cd82 100644 Binary files a/bff/etc/product.pb and b/bff/etc/product.pb differ diff --git a/bff/internal/response/middleware.go b/bff/internal/response/middleware.go index dedbd51..4be30a6 100644 --- a/bff/internal/response/middleware.go +++ b/bff/internal/response/middleware.go @@ -54,6 +54,7 @@ func Wrap(next http.HandlerFunc) http.HandlerFunc { } } +// unwrapJSONData 将 RPC Response.data(proto string)里的 JSON 文本还原为对象/数组/数字。 func unwrapJSONData(v any) any { s, ok := v.(string) if !ok { @@ -63,9 +64,6 @@ func unwrapJSONData(v any) any { if s == "" { return nil } - if s[0] != '{' && s[0] != '[' { - return v - } var parsed any if err := json.Unmarshal([]byte(s), &parsed); err != nil { return v