From b8a2ded90866a285e9022c842e546d8a6fa5fa6d Mon Sep 17 00:00:00 2001 From: Anyon Date: Tue, 16 Jun 2020 16:28:49 +0800 Subject: [PATCH] =?UTF-8?q?#238=20=E4=BF=AE=E6=94=B9=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/wechat/controller/api/Push.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/wechat/controller/api/Push.php b/app/wechat/controller/api/Push.php index 30548188f..8569c4168 100644 --- a/app/wechat/controller/api/Push.php +++ b/app/wechat/controller/api/Push.php @@ -93,14 +93,13 @@ class Push extends Controller public function index() { try { - if ($this->request->has('receive', 'post') && WechatService::instance()->getType() === 'thr') { - $this->forceJson = true; // 强制返回JSON到Service转发 + if ($this->request->has('json', 'post') && WechatService::instance()->getType() === 'thr') { + $this->forceJson = true; // 强制回复 JSON 到 SERVICE $this->forceCustom = false; // 强制使用客服消息模式推送 $this->appid = $this->request->post('appid', '', null); $this->openid = $this->request->post('openid', '', null); $this->encrypt = boolval($this->request->post('encrypt', 0)); - $receive = $this->request->post('receive', '', null); - $this->receive = $this->toLower(unserialize($receive, ['allowed_classes' => false])); + $this->receive = $this->toLower(json_decode(input('params', '[]'), true)); if (empty($this->appid) || empty($this->openid) || empty($this->receive)) { throw new \think\Exception('微信API实例缺失必要参数[appid,openid,receive]'); }