This commit is contained in:
尖叫 2023-12-06 17:40:02 +08:00
parent 0e6cb66fd5
commit 36b4c5eac5

View File

@ -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 {
//返回文本提醒