From fe3b5910baea03b2c150598344e25648d2a2fd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sun, 16 Aug 2020 14:59:53 +0800 Subject: [PATCH] Update Tools.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改接口兼容 --- WeChat/Contracts/Tools.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WeChat/Contracts/Tools.php b/WeChat/Contracts/Tools.php index fe3882e..8209cae 100644 --- a/WeChat/Contracts/Tools.php +++ b/WeChat/Contracts/Tools.php @@ -360,6 +360,11 @@ class Tools $mycurl = new MyCurlFile((array)$value); $data[$key] = $mycurl->get(); array_push(self::$cache_curl, $mycurl->tempname); + } elseif (is_array($value) && isset($value['datatype']) && $value['datatype'] === 'MY_CURL_FILE') { + $build = false; + $mycurl = new MyCurlFile($value); + $data[$key] = $mycurl->get(); + array_push(self::$cache_curl, $mycurl->tempname); } elseif (is_string($value) && class_exists('CURLFile', false) && stripos($value, '@') === 0) { if (($filename = realpath(trim($value, '@'))) && file_exists($filename)) { $build = false; @@ -458,4 +463,4 @@ class Tools file_exists(self::$cache_path) || mkdir(self::$cache_path, 0755, true); return self::$cache_path . $name; } -} \ No newline at end of file +}