From de4f58d3e3e05cd45b53b809d18fe9c2deac8a64 Mon Sep 17 00:00:00 2001 From: whwyy Date: Tue, 7 May 2024 14:38:47 +0800 Subject: [PATCH] eee --- wx/SecCheck.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/wx/SecCheck.php b/wx/SecCheck.php index b9ac6fe..b955e5b 100644 --- a/wx/SecCheck.php +++ b/wx/SecCheck.php @@ -63,18 +63,32 @@ class SecCheck extends SmallProgram } + + + const SCENE_INFO = 1; + const SCENE_REPLY = 2; + const SCENE_DISCAZ = 3; + const SCENE_SHEJIAO = 4; + /** * @param string $content + * @param int $scene + * @param string $openId * @return Result */ - public function text(string $content): Result + public function text(string $content, int $scene, string $openId): Result { if (empty($content)) { return $this->sendError('文件不存在', 404); } $requestUrl = $this->_msgUrl . $this->payConfig->getAccessToken(); - return $this->post('api.weixin.qq.com', $requestUrl, ['content' => $content]); + return $this->post('api.weixin.qq.com', $requestUrl, json_encode([ + 'content' => $content, + 'version' => 2, + 'scene' => $scene, + 'openid' => $openId + ], JSON_UNESCAPED_UNICODE),'application/json'); } }