From 93ef2bdfdff6fd86d7f2c39c560eb71a86b8ce80 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 15 Jul 2019 17:05:42 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B5=8B=E8=AF=95]=E5=BE=AE=E4=BF=A1=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/handler/ReceiveHandler.php | 4 +++- application/wechat/controller/api/Push.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/application/service/handler/ReceiveHandler.php b/application/service/handler/ReceiveHandler.php index b145cc7bf..9e27fc309 100644 --- a/application/service/handler/ReceiveHandler.php +++ b/application/service/handler/ReceiveHandler.php @@ -59,7 +59,9 @@ class ReceiveHandler if (is_array($json = json_decode($result, true))) { p('===== 已返回xml加密内容 ====='); p($json); - return $service->reply($json, true, $service->isEncrypt()); + $xml = $service->reply($json, true, $service->isEncrypt()); + p($xml); + return $xml; } else { p('===== 直接回复返回的内容 ====='); return $result; diff --git a/application/wechat/controller/api/Push.php b/application/wechat/controller/api/Push.php index a8bd726a1..033cf0c8d 100644 --- a/application/wechat/controller/api/Push.php +++ b/application/wechat/controller/api/Push.php @@ -94,7 +94,6 @@ class Push extends Controller public function index() { try { - $this->wechat = WechatService::WeChatReceive(); if ($this->request->has('receive', 'post') && WechatService::getType() === 'thr') { $this->forceJson = true; // 强制返回JSON到服务端再转发 $this->forceCustom = false; // 暂停使用客户消息模式 @@ -108,6 +107,7 @@ class Push extends Controller } else { $this->forceJson = false; // 暂停返回JSON消息对象 $this->forceCustom = false; // 暂停使用客户消息模式 + $this->wechat = WechatService::WeChatReceive(); $this->appid = WechatService::getAppid(); $this->openid = $this->wechat->getOpenid(); $this->encrypt = $this->wechat->isEncrypt();