diff --git a/WeChat/Contracts/Tools.php b/WeChat/Contracts/Tools.php index 4cfe9b8..a9bf0a9 100644 --- a/WeChat/Contracts/Tools.php +++ b/WeChat/Contracts/Tools.php @@ -155,7 +155,7 @@ class Tools { return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', function ($matches) { return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE"); - }, json_encode($data)); + }, ($jsonData = json_encode($data)) == '[]' ? '{}' : $jsonData); } /**