From 36b4c5eac54edebca68242ba66f4adc50928334d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=96=E5=8F=AB?= <392494244@qq.com> Date: Wed, 6 Dec 2023 17:40:02 +0800 Subject: [PATCH] 1 --- extend/hema/wechat/Index.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/extend/hema/wechat/Index.php b/extend/hema/wechat/Index.php index 560345b..f294b71 100644 --- a/extend/hema/wechat/Index.php +++ b/extend/hema/wechat/Index.php @@ -41,13 +41,19 @@ class Index exit; } - die('success'); + //接收微信推送数据 $nonce = empty ($_GET ['nonce']) ? "" : trim($_GET ['nonce']); $signature = empty ($_GET['signature']) ? "" : trim($_GET ['signature']); $timeStamp = empty ($_GET ['timestamp']) ? "" : trim($_GET ['timestamp']); $msg_signature = empty ($_GET['msg_signature']) ? "" : trim($_GET ['msg_signature']); $encryptMsg = file_get_contents('php://input'); + + write_log($encryptMsg, __DIR__); + + die('success'); + + $pc = new WxBizMsgCrypt();//创建解密类 $msg = ''; $errCode = $pc->decryptMsg($msg_signature, $timeStamp, $nonce, $encryptMsg, $msg); @@ -62,16 +68,7 @@ class Index //用户操作 $model = new UserModel; if ($user = $model->subscribe($wechat_user, $this->wechat['applet_id'])) { - if ($this->wechat['applet_id'] == 0) { - $wx->sendServiceMsg([ - 'type' => 'text', - 'content' => '请妥善保管您的账号和密码~账号:' . $user['user_name'] . ',密码:' . $user['password'] . ',如忘记回复“找回账号”找回~' - ], $data['FromUserName'], $this->wechat['applet_id']); - } - } - if (isset($data['Ticket']) and $data['EventKey'] == 'qrscene_login') { - //扫码关注公众号 - Cache::set($data['Ticket'], $wechat_user, 3600); + } } else { //返回文本提醒