post请求验证提交的微信名称

This commit is contained in:
wangxiaowei 2024-09-25 10:52:08 +08:00
parent 281f53f0a8
commit a042e798be

@ -59,14 +59,24 @@ class User extends Api
} else {
$userAuth = Db::name('user_auth')->where('user_id', $this->user_id)->find();
if($userAuth) {
$result = Request::post('https://api.weixin.qq.com/wxa/msg_sec_check', [
$postData = [
'access_token' => $response['access_token'],
'content' => $post['value'],
'version' => 2,
'scene' => 1,
'openid' => $userAuth['openid']
]);
dump($result);die;
];
$ch = curl_init(); // 初始化curl
curl_setopt($ch, CURLOPT_URL, 'https://api.weixin.qq.com/wxa/msg_sec_check'); // 抓取指定网页
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // 要求结果为字符串并输出到屏幕上
curl_setopt($ch, CURLOPT_POST, 1); // post请求方式
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); // post变量
$output = curl_exec($ch);
curl_close();
dump($output);die;
}
return JsonServer::error('暂无授权信息');