diff --git a/app/admin/controller/api/Plugs.php b/app/admin/controller/api/Plugs.php index 11a905160..cda02fa0e 100644 --- a/app/admin/controller/api/Plugs.php +++ b/app/admin/controller/api/Plugs.php @@ -53,8 +53,8 @@ class Plugs extends Controller $this->success('网站缓存加速成功!'); } catch (HttpResponseException $exception) { throw $exception; - } catch (\Exception $e) { - $this->error($e->getMessage()); + } catch (\Exception $exception) { + $this->error($exception->getMessage()); } } @@ -74,8 +74,8 @@ class Plugs extends Controller $this->success('清理网站缓存成功!'); } catch (HttpResponseException $exception) { throw $exception; - } catch (\Exception $e) { - $this->error($e->getMessage()); + } catch (\Exception $exception) { + $this->error($exception->getMessage()); } } diff --git a/app/admin/controller/api/Update.php b/app/admin/controller/api/Update.php index d279a78d0..da7853d90 100644 --- a/app/admin/controller/api/Update.php +++ b/app/admin/controller/api/Update.php @@ -32,9 +32,7 @@ class Update extends Controller { $this->file = $this->app->getRootPath() . decode(input('encode', '0')); if (file_exists($this->file)) { - $this->success('读取文件成功!', [ - 'content' => base64_encode(file_get_contents($this->file)), - ]); + $this->success('读取文件成功!', ['content' => base64_encode(file_get_contents($this->file))]); } else { $this->error('读取文件内容失败!'); } diff --git a/composer.lock b/composer.lock index c1bd354b4..87daee717 100644 --- a/composer.lock +++ b/composer.lock @@ -962,16 +962,16 @@ }, { "name": "zoujingli/wechat-developer", - "version": "v1.2.20", + "version": "v1.2.21", "source": { "type": "git", "url": "https://github.com/zoujingli/WeChatDeveloper.git", - "reference": "9afb0a29c658d52dc7b9d46d2f848602124936b7" + "reference": "5cf008c37471f775ae28a23fd1ac06c91eac682f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/9afb0a29c658d52dc7b9d46d2f848602124936b7", - "reference": "9afb0a29c658d52dc7b9d46d2f848602124936b7", + "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/5cf008c37471f775ae28a23fd1ac06c91eac682f", + "reference": "5cf008c37471f775ae28a23fd1ac06c91eac682f", "shasum": "", "mirrors": [ { @@ -988,6 +988,7 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-simplexml": "*", + "ext-xml": "*", "php": ">=5.4" }, "type": "library", @@ -1023,7 +1024,7 @@ "wechatpay", "wepay" ], - "time": "2020-03-14T06:58:18+00:00" + "time": "2020-04-26T03:12:37+00:00" } ], "packages-dev": [], diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f52a2e7cf..af0f29c8f 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -989,17 +989,17 @@ }, { "name": "zoujingli/wechat-developer", - "version": "v1.2.20", - "version_normalized": "1.2.20.0", + "version": "v1.2.21", + "version_normalized": "1.2.21.0", "source": { "type": "git", "url": "https://github.com/zoujingli/WeChatDeveloper.git", - "reference": "9afb0a29c658d52dc7b9d46d2f848602124936b7" + "reference": "5cf008c37471f775ae28a23fd1ac06c91eac682f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/9afb0a29c658d52dc7b9d46d2f848602124936b7", - "reference": "9afb0a29c658d52dc7b9d46d2f848602124936b7", + "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/5cf008c37471f775ae28a23fd1ac06c91eac682f", + "reference": "5cf008c37471f775ae28a23fd1ac06c91eac682f", "shasum": "", "mirrors": [ { @@ -1016,9 +1016,10 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-simplexml": "*", + "ext-xml": "*", "php": ">=5.4" }, - "time": "2020-03-14T06:58:18+00:00", + "time": "2020-04-26T03:12:37+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/vendor/services.php b/vendor/services.php index 2266fa1ae..5d672b0bd 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/wechat-developer/We.php b/vendor/zoujingli/wechat-developer/We.php index fb3e69145..6523ec3af 100644 --- a/vendor/zoujingli/wechat-developer/We.php +++ b/vendor/zoujingli/wechat-developer/We.php @@ -56,6 +56,7 @@ use WeChat\Exceptions\InvalidInstanceException; * @method \WeMini\Delivery WeMiniDelivery($options = []) static 小程序即时配送 * @method \WeMini\Guide WeMiniGuide($options = []) static 小程序导购助手 * @method \WeMini\Image WeMiniImage($options = []) static 小程序图像处理 + * @method \WeMini\Live WeMiniLive($options = []) static 小程序直播接口 * @method \WeMini\Logistics WeMiniLogistics($options = []) static 小程序物流助手 * @method \WeMini\Message WeMiniMessage($options = []) static 小程序动态消息 * @method \WeMini\Newtmpl WeMiniNewtmpl($options = []) static 小程序订阅消息 @@ -85,7 +86,7 @@ class We * 定义当前版本 * @var string */ - const VERSION = '1.2.20'; + const VERSION = '1.2.21'; /** * 静态配置 diff --git a/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php b/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php index 60a435d5c..ce353f6e9 100644 --- a/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php +++ b/vendor/zoujingli/wechat-developer/WeChat/Contracts/Tools.php @@ -164,6 +164,20 @@ class Tools return json_decode(json_encode($data), true); } + /** + * 解析XML文本内容 + * @param string $xml + * @return boolean|mixed + */ + public static function xml3arr($xml) + { + if (xml_parse($parser = xml_parser_create(), $xml, true)) { + return json_decode(json_encode(simplexml_load_string($xml)), true); + } + if (is_resource($parser)) xml_parser_free($parser); + return false; + } + /** * 数组转xml内容 * @param array $data diff --git a/vendor/zoujingli/wechat-developer/WePay/Bill.php b/vendor/zoujingli/wechat-developer/WePay/Bill.php index 4c853c700..602fbc712 100644 --- a/vendor/zoujingli/wechat-developer/WePay/Bill.php +++ b/vendor/zoujingli/wechat-developer/WePay/Bill.php @@ -39,7 +39,7 @@ class Bill extends BasicWePay $params = $this->params->merge($options); $params['sign'] = $this->getPaySign($params, 'MD5'); $result = Tools::post('https://api.mch.weixin.qq.com/pay/downloadbill', Tools::arr2xml($params)); - if (($jsonData = Tools::xml2arr($result))) { + if (is_array($jsonData = Tools::xml3arr($result))) { if ($jsonData['return_code'] !== 'SUCCESS') { throw new InvalidResponseException($jsonData['return_msg'], '0'); } diff --git a/vendor/zoujingli/wechat-developer/composer.json b/vendor/zoujingli/wechat-developer/composer.json index d21c7f04c..b0c41e380 100644 --- a/vendor/zoujingli/wechat-developer/composer.json +++ b/vendor/zoujingli/wechat-developer/composer.json @@ -21,6 +21,7 @@ ], "require": { "php": ">=5.4", + "ext-xml": "*", "ext-json": "*", "ext-curl": "*", "ext-bcmath": "*",