1
This commit is contained in:
parent
0e6cb66fd5
commit
36b4c5eac5
@ -41,13 +41,19 @@ class Index
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
die('success');
|
|
||||||
//接收微信推送数据
|
//接收微信推送数据
|
||||||
$nonce = empty ($_GET ['nonce']) ? "" : trim($_GET ['nonce']);
|
$nonce = empty ($_GET ['nonce']) ? "" : trim($_GET ['nonce']);
|
||||||
$signature = empty ($_GET['signature']) ? "" : trim($_GET ['signature']);
|
$signature = empty ($_GET['signature']) ? "" : trim($_GET ['signature']);
|
||||||
$timeStamp = empty ($_GET ['timestamp']) ? "" : trim($_GET ['timestamp']);
|
$timeStamp = empty ($_GET ['timestamp']) ? "" : trim($_GET ['timestamp']);
|
||||||
$msg_signature = empty ($_GET['msg_signature']) ? "" : trim($_GET ['msg_signature']);
|
$msg_signature = empty ($_GET['msg_signature']) ? "" : trim($_GET ['msg_signature']);
|
||||||
$encryptMsg = file_get_contents('php://input');
|
$encryptMsg = file_get_contents('php://input');
|
||||||
|
|
||||||
|
write_log($encryptMsg, __DIR__);
|
||||||
|
|
||||||
|
die('success');
|
||||||
|
|
||||||
|
|
||||||
$pc = new WxBizMsgCrypt();//创建解密类
|
$pc = new WxBizMsgCrypt();//创建解密类
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$errCode = $pc->decryptMsg($msg_signature, $timeStamp, $nonce, $encryptMsg, $msg);
|
$errCode = $pc->decryptMsg($msg_signature, $timeStamp, $nonce, $encryptMsg, $msg);
|
||||||
@ -62,16 +68,7 @@ class Index
|
|||||||
//用户操作
|
//用户操作
|
||||||
$model = new UserModel;
|
$model = new UserModel;
|
||||||
if ($user = $model->subscribe($wechat_user, $this->wechat['applet_id'])) {
|
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 {
|
} else {
|
||||||
//返回文本提醒
|
//返回文本提醒
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user