'init'
This commit is contained in:
89
qa.php
Normal file
89
qa.php
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
// $TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyMTg3NzE0OCwidXNlcklkIjo3OTg2NTJ9.fddSOIceIpNA_qiT7tLu6fTDFoZMrtxngKIdpgIWKwA'; // zb
|
||||||
|
|
||||||
|
$TO = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyNDAzMDY4OSwidXNlcklkIjoxOTY0ODg3fQ.CtOIOW2FeobC92YmrxT7M2inxluEMS3348jpqTK57A4';// iuu
|
||||||
|
|
||||||
|
$arr = [ $TO];
|
||||||
|
|
||||||
|
$activityId = 765647;
|
||||||
|
$totalCost = '24';
|
||||||
|
$groupId = 1276594;
|
||||||
|
|
||||||
|
foreach ($arr as $token) {
|
||||||
|
$custom_post_headers = [
|
||||||
|
'Host: www.shuote.top:8082',
|
||||||
|
'Connection: keep-alive',
|
||||||
|
'Request-Channel: MP-WEIXIN',
|
||||||
|
'X-Access-Token: ' . $token,
|
||||||
|
'Accept-Encoding: gzip,compress,br,deflate',
|
||||||
|
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.49(0x18003137) NetType/WIFI Language/zh_CN',
|
||||||
|
'Referer: https://servicewechat.com/wxbb50595cab69d719/403/page-frame.html'
|
||||||
|
];
|
||||||
|
|
||||||
|
$url = 'https://www.shuote.top:8082/flash/activity/applyActivity';
|
||||||
|
$post_data = [
|
||||||
|
"payAmount" => $totalCost,
|
||||||
|
"activityId" => $activityId,
|
||||||
|
"maleCount" => 0,
|
||||||
|
"femaleCount" => 0,
|
||||||
|
"payType" => 3,
|
||||||
|
// "hangPeopleDetails" => [],
|
||||||
|
"groupId" => $groupId,
|
||||||
|
// "applyRemark" => "",
|
||||||
|
// "teamName" => "",
|
||||||
|
// "idNumber" => "",
|
||||||
|
// "birthday" => "",
|
||||||
|
"xbSex" => null,
|
||||||
|
"cardType" => 1,
|
||||||
|
// "realName" => "",
|
||||||
|
// "memberRemarkList" => [],
|
||||||
|
// "trackActMemberProjectDoList" => []
|
||||||
|
];
|
||||||
|
var_dump(json_encode($post_data));
|
||||||
|
$response = api_request_curl($url, $custom_post_headers, $post_data);
|
||||||
|
echo $response;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function api_request_curl($url, $custom_headers = [], $postData = array())
|
||||||
|
{
|
||||||
|
|
||||||
|
if (empty($url)) return '';
|
||||||
|
$postData = json_encode($postData);
|
||||||
|
|
||||||
|
$curl = curl_init(); //初始化
|
||||||
|
curl_setopt($curl, CURLOPT_URL, $url); //设置url
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); //设置http验证方法
|
||||||
|
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //设置curl_exec获取的信息的返回方式
|
||||||
|
curl_setopt($curl, CURLOPT_POST, 1); //设置发送方式为post请求
|
||||||
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); //设置post的数据
|
||||||
|
// 如果有自定义请求头,则设置请求头
|
||||||
|
// if (!empty($custom_headers)) {
|
||||||
|
// curl_setopt($curl, CURLOPT_HTTPHEADER, $custom_headers);
|
||||||
|
// }
|
||||||
|
|
||||||
|
$array = array_merge($custom_headers, array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Content-Length: ' . strlen($postData))
|
||||||
|
);
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $array);
|
||||||
|
// 接受压缩响应
|
||||||
|
curl_setopt($curl, CURLOPT_ENCODING, '');
|
||||||
|
|
||||||
|
|
||||||
|
$result = curl_exec($curl);
|
||||||
|
if ($result === false) {
|
||||||
|
throw new Exception('Http request message :' . curl_error($curl));
|
||||||
|
}
|
||||||
|
curl_close($curl);
|
||||||
|
// 尝试解压缩响应数据
|
||||||
|
$decoded_response = @gzdecode($result);
|
||||||
|
if ($decoded_response !== false) {
|
||||||
|
return $decoded_response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
89
qc.php
Normal file
89
qc.php
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
// $TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyMTg3NzE0OCwidXNlcklkIjo3OTg2NTJ9.fddSOIceIpNA_qiT7tLu6fTDFoZMrtxngKIdpgIWKwA'; // zb
|
||||||
|
|
||||||
|
$TO = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyNDAzMDk5NCwidXNlcklkIjo3OTg2NTJ9.hMGKFQtwqs6spPGo0VnT9-7EeWuscKSoVzhxH83tQg4'; // zb
|
||||||
|
|
||||||
|
$arr = [ $TO];
|
||||||
|
|
||||||
|
$activityId = 765647;
|
||||||
|
$totalCost = '24';
|
||||||
|
$groupId = 1276594;
|
||||||
|
|
||||||
|
foreach ($arr as $token) {
|
||||||
|
$custom_post_headers = [
|
||||||
|
'Host: www.shuote.top:8082',
|
||||||
|
'Connection: keep-alive',
|
||||||
|
'Request-Channel: MP-WEIXIN',
|
||||||
|
'X-Access-Token: ' . $token,
|
||||||
|
'Accept-Encoding: gzip,compress,br,deflate',
|
||||||
|
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.49(0x18003137) NetType/WIFI Language/zh_CN',
|
||||||
|
'Referer: https://servicewechat.com/wxbb50595cab69d719/403/page-frame.html'
|
||||||
|
];
|
||||||
|
|
||||||
|
$url = 'https://www.shuote.top:8082/flash/activity/applyActivity';
|
||||||
|
$post_data = [
|
||||||
|
"payAmount" => $totalCost,
|
||||||
|
"activityId" => $activityId,
|
||||||
|
"maleCount" => 0,
|
||||||
|
"femaleCount" => 0,
|
||||||
|
"payType" => 3,
|
||||||
|
// "hangPeopleDetails" => [],
|
||||||
|
"groupId" => $groupId,
|
||||||
|
// "applyRemark" => "",
|
||||||
|
// "teamName" => "",
|
||||||
|
// "idNumber" => "",
|
||||||
|
// "birthday" => "",
|
||||||
|
"xbSex" => null,
|
||||||
|
"cardType" => 1,
|
||||||
|
// "realName" => "",
|
||||||
|
// "memberRemarkList" => [],
|
||||||
|
// "trackActMemberProjectDoList" => []
|
||||||
|
];
|
||||||
|
var_dump(json_encode($post_data));
|
||||||
|
$response = api_request_curl($url, $custom_post_headers, $post_data);
|
||||||
|
echo $response;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function api_request_curl($url, $custom_headers = [], $postData = array())
|
||||||
|
{
|
||||||
|
|
||||||
|
if (empty($url)) return '';
|
||||||
|
$postData = json_encode($postData);
|
||||||
|
|
||||||
|
$curl = curl_init(); //初始化
|
||||||
|
curl_setopt($curl, CURLOPT_URL, $url); //设置url
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); //设置http验证方法
|
||||||
|
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //设置curl_exec获取的信息的返回方式
|
||||||
|
curl_setopt($curl, CURLOPT_POST, 1); //设置发送方式为post请求
|
||||||
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); //设置post的数据
|
||||||
|
// 如果有自定义请求头,则设置请求头
|
||||||
|
// if (!empty($custom_headers)) {
|
||||||
|
// curl_setopt($curl, CURLOPT_HTTPHEADER, $custom_headers);
|
||||||
|
// }
|
||||||
|
|
||||||
|
$array = array_merge($custom_headers, array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Content-Length: ' . strlen($postData))
|
||||||
|
);
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $array);
|
||||||
|
// 接受压缩响应
|
||||||
|
curl_setopt($curl, CURLOPT_ENCODING, '');
|
||||||
|
|
||||||
|
|
||||||
|
$result = curl_exec($curl);
|
||||||
|
if ($result === false) {
|
||||||
|
throw new Exception('Http request message :' . curl_error($curl));
|
||||||
|
}
|
||||||
|
curl_close($curl);
|
||||||
|
// 尝试解压缩响应数据
|
||||||
|
$decoded_response = @gzdecode($result);
|
||||||
|
if ($decoded_response !== false) {
|
||||||
|
return $decoded_response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
89
qd.php
Normal file
89
qd.php
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
$TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyMjgyOTc3MiwidXNlcklkIjo3OTg2NTJ9.9aTj_LiugdKptbErvGoeLYBvg8x9HZLl6fUWPrKFJ6o'; // zb
|
||||||
|
|
||||||
|
// $TO = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyMTg3ODg3MCwidXNlcklkIjoxOTY0ODg3fQ.vKymJVTzUzB6jKBn_rfne89NpNR2NC7vne12esEYVlY'; // IUU
|
||||||
|
|
||||||
|
$arr = [$TOKEN];
|
||||||
|
|
||||||
|
$activityId = 748226;
|
||||||
|
$totalCost = '23.5';
|
||||||
|
$groupId = 1251763;
|
||||||
|
|
||||||
|
foreach ($arr as $token) {
|
||||||
|
$custom_post_headers = [
|
||||||
|
'Host: www.shuote.top:8082',
|
||||||
|
'Connection: keep-alive',
|
||||||
|
'Request-Channel: MP-WEIXIN',
|
||||||
|
'X-Access-Token: ' . $token,
|
||||||
|
'Accept-Encoding: gzip,compress,br,deflate',
|
||||||
|
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.49(0x18003137) NetType/WIFI Language/zh_CN',
|
||||||
|
'Referer: https://servicewechat.com/wxbb50595cab69d719/403/page-frame.html'
|
||||||
|
];
|
||||||
|
|
||||||
|
$url = 'https://www.shuote.top:8082/flash/activity/applyActivity';
|
||||||
|
$post_data = [
|
||||||
|
"payAmount" => $totalCost,
|
||||||
|
"activityId" => $activityId,
|
||||||
|
"maleCount" => 0,
|
||||||
|
"femaleCount" => 0,
|
||||||
|
"payType" => 3,
|
||||||
|
// "hangPeopleDetails" => [],
|
||||||
|
"groupId" => $groupId,
|
||||||
|
// "applyRemark" => "",
|
||||||
|
// "teamName" => "",
|
||||||
|
// "idNumber" => "",
|
||||||
|
// "birthday" => "",
|
||||||
|
"xbSex" => null,
|
||||||
|
"cardType" => 1,
|
||||||
|
// "realName" => "",
|
||||||
|
// "memberRemarkList" => [],
|
||||||
|
// "trackActMemberProjectDoList" => []
|
||||||
|
];
|
||||||
|
var_dump(json_encode($post_data));
|
||||||
|
$response = api_request_curl($url, $custom_post_headers, $post_data);
|
||||||
|
echo $response;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function api_request_curl($url, $custom_headers = [], $postData = array())
|
||||||
|
{
|
||||||
|
|
||||||
|
if (empty($url)) return '';
|
||||||
|
$postData = json_encode($postData);
|
||||||
|
|
||||||
|
$curl = curl_init(); //初始化
|
||||||
|
curl_setopt($curl, CURLOPT_URL, $url); //设置url
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); //设置http验证方法
|
||||||
|
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //设置curl_exec获取的信息的返回方式
|
||||||
|
curl_setopt($curl, CURLOPT_POST, 1); //设置发送方式为post请求
|
||||||
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); //设置post的数据
|
||||||
|
// 如果有自定义请求头,则设置请求头
|
||||||
|
// if (!empty($custom_headers)) {
|
||||||
|
// curl_setopt($curl, CURLOPT_HTTPHEADER, $custom_headers);
|
||||||
|
// }
|
||||||
|
|
||||||
|
$array = array_merge($custom_headers, array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Content-Length: ' . strlen($postData))
|
||||||
|
);
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $array);
|
||||||
|
// 接受压缩响应
|
||||||
|
curl_setopt($curl, CURLOPT_ENCODING, '');
|
||||||
|
|
||||||
|
|
||||||
|
$result = curl_exec($curl);
|
||||||
|
if ($result === false) {
|
||||||
|
throw new Exception('Http request message :' . curl_error($curl));
|
||||||
|
}
|
||||||
|
curl_close($curl);
|
||||||
|
// 尝试解压缩响应数据
|
||||||
|
$decoded_response = @gzdecode($result);
|
||||||
|
if ($decoded_response !== false) {
|
||||||
|
return $decoded_response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
272
qq.php
Normal file
272
qq.php
Normal file
@@ -0,0 +1,272 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyMjgyOTc3MiwidXNlcklkIjo3OTg2NTJ9.9aTj_LiugdKptbErvGoeLYBvg8x9HZLl6fUWPrKFJ6o'; // zb
|
||||||
|
|
||||||
|
|
||||||
|
$TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyMjgyOTkzOSwidXNlcklkIjoxMDU1NzgwfQ.CpMhGx0uWDOJe2xCeqQ_zDyxkelGTsIoUQs3J0aH0aw'; // 牛奶咖啡
|
||||||
|
|
||||||
|
$TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyNDAzMDY4OSwidXNlcklkIjoxOTY0ODg3fQ.CtOIOW2FeobC92YmrxT7M2inxluEMS3348jpqTK57A4'; // 高新菜鸟
|
||||||
|
|
||||||
|
$activityTitle = '';
|
||||||
|
$activityId = 765647;
|
||||||
|
$totalCost = '24';
|
||||||
|
$groupId = 1276594;
|
||||||
|
$pay = false;
|
||||||
|
$custom_get_headers = [
|
||||||
|
'Host: www.shuote.top:8082',
|
||||||
|
'Connection: keep-alive',
|
||||||
|
'Request-Channel: MP-WEIXIN',
|
||||||
|
'content-type: application/json',
|
||||||
|
'X-Access-Token: ' . $TOKEN,
|
||||||
|
'Accept-Encoding: gzip,compress,br,deflate',
|
||||||
|
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.49(0x18003137) NetType/WIFI Language/zh_CN',
|
||||||
|
'Referer: https://servicewechat.com/wxbb50595cab69d719/403/page-frame.html'
|
||||||
|
];
|
||||||
|
$custom_post_headers = [
|
||||||
|
'Host: www.shuote.top:8082',
|
||||||
|
'Connection: keep-alive',
|
||||||
|
'Request-Channel: MP-WEIXIN',
|
||||||
|
'X-Access-Token: ' . $TOKEN,
|
||||||
|
'Accept-Encoding: gzip,compress,br,deflate',
|
||||||
|
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.49(0x18003137) NetType/WIFI Language/zh_CN',
|
||||||
|
'Referer: https://servicewechat.com/wxbb50595cab69d719/403/page-frame.html'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
if ($pay) {
|
||||||
|
$url = 'https://www.shuote.top:8082/flash/activity/applyActivity';
|
||||||
|
$post_data = [
|
||||||
|
"payAmount" => $totalCost,
|
||||||
|
"activityId" => $activityId,
|
||||||
|
"maleCount" => 0,
|
||||||
|
"femaleCount" => 0,
|
||||||
|
"payType" => 3,
|
||||||
|
"hangPeopleDetails" => [],
|
||||||
|
"groupId" => $groupId,
|
||||||
|
"applyRemark" => "",
|
||||||
|
"teamName" => "",
|
||||||
|
"idNumber" => "",
|
||||||
|
"birthday" => "",
|
||||||
|
"xbSex" => null,
|
||||||
|
"cardType" => 1,
|
||||||
|
"realName" => "",
|
||||||
|
"memberRemarkList" => [],
|
||||||
|
"trackActMemberProjectDoList" => []
|
||||||
|
];
|
||||||
|
var_dump(json_encode($post_data));
|
||||||
|
$response = api_request_curl($url, $custom_post_headers, $post_data);
|
||||||
|
echo $response;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
//$str = '奥体打球';
|
||||||
|
//$str = urlencode($str);
|
||||||
|
//$searchListUrl = 'https://www.shuote.top:8082/flash/activity/searchList?keyWord='.$str.'&city=%E6%B5%8E%E5%8D%97%E5%B8%82&sportId=1&longitude=116.89963406032986&latitude=36.66725802951389&pageSize=15&pageNo=1&isHas=true&isLoading=false&isLimitPublisher=0';
|
||||||
|
//$response = curl_get_with_custom_headers($searchListUrl, $custom_get_headers);
|
||||||
|
//$data = json_decode($response, true);
|
||||||
|
//var_dump($data);
|
||||||
|
//exit();
|
||||||
|
|
||||||
|
|
||||||
|
// 菜单
|
||||||
|
//$url = 'https://www.shuote.top:8082/flash/sport/sortList';
|
||||||
|
// 活动列表
|
||||||
|
//$url = 'https://www.shuote.top:8082/flash/activity/list?pageNo=1&pageSize=100&sortRule=0&latitude=36.66725802951389&longitude=116.89963406032986&area=&city=%E6%B5%8E%E5%8D%97&nearby=&date=&levelLower=1&levelUpper=9&sportId=1';
|
||||||
|
|
||||||
|
if (!$pay) {
|
||||||
|
|
||||||
|
$user = "https://www.shuote.top:8082/flash/user/getUserInfo?sportId=11";
|
||||||
|
$response = curl_get_with_custom_headers($user, $custom_get_headers);
|
||||||
|
$data = json_decode($response, true);
|
||||||
|
if (!empty($data) && $data['code'] == 200) {
|
||||||
|
$nickName = $data['result']['nickName'];
|
||||||
|
echo "账户:" . $nickName . "<br/>" . PHP_EOL;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$userWallet = 'https://www.shuote.top:8082/flash/wallet/userWallet';
|
||||||
|
$response = curl_get_with_custom_headers($userWallet, $custom_get_headers);
|
||||||
|
$data = json_decode($response, true);
|
||||||
|
if (!empty($data) && $data['code'] == 200) {
|
||||||
|
$totalAmount = $data['result']['totalAmount'];
|
||||||
|
$availableAmount = $data['result']['availableAmount'];
|
||||||
|
$frozenAmount = $data['result']['frozenAmount'];
|
||||||
|
echo "总余额:" . $totalAmount . "<br/>" . PHP_EOL;
|
||||||
|
echo "冻结中:" . $frozenAmount . "<br/>" . PHP_EOL;
|
||||||
|
echo "可提现:" . $availableAmount . "<br/>" . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 活动详情
|
||||||
|
//$detailUrl = 'https://www.shuote.top:8082/flash/activity/detail?activityId=661001&latitude=36.66725802951389&longitude=116.89963406032986';
|
||||||
|
$detailUrl = 'https://www.shuote.top:8082/flash/activity/detail?activityId=' . $activityId . '&latitude=36.66725802951389&longitude=116.89963406032986';
|
||||||
|
$response = curl_get_with_custom_headers($detailUrl, $custom_get_headers);
|
||||||
|
$data = json_decode($response, true);
|
||||||
|
//var_dump($data);
|
||||||
|
if (!empty($data) && $data['code'] == 200) {
|
||||||
|
$activityId = $data['result']['activityId'];
|
||||||
|
$activityTitle = $data['result']['activityTitle'];
|
||||||
|
$totalCost = $data['result']['totalCost'];
|
||||||
|
echo "活动ID:" . $activityId . "<br/>" . PHP_EOL;
|
||||||
|
echo "活动名称:" . $activityTitle . "<br/>" . PHP_EOL;
|
||||||
|
echo "报名价格:" . $totalCost . "<br/>" . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// getApplyInfo
|
||||||
|
|
||||||
|
$getApplyInfoUrl = 'https://www.shuote.top:8082/flash/activity/getApplyInfo?activityId=' . $activityId;
|
||||||
|
$response = curl_get_with_custom_headers($getApplyInfoUrl, $custom_get_headers);
|
||||||
|
$data = json_decode($response, true);
|
||||||
|
if (!empty($data) && $data['code'] == 200) {
|
||||||
|
$resp = $data['result']['actGroups'];
|
||||||
|
foreach ($resp as $group) {
|
||||||
|
echo "报名组ID:" . $group['groupId'] . "----报名组名称" . $group['groupName'] . "<br/>" . PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function curl_get_with_custom_headers($url, $custom_headers = [])
|
||||||
|
{
|
||||||
|
// 初始化 cURL 会话
|
||||||
|
$ch = curl_init();
|
||||||
|
|
||||||
|
// 设置 cURL 选项
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url); // 设置请求的 URL
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // 设置返回结果为字符串,而不是直接输出
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, false); // 不输出头信息
|
||||||
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // 跟踪重定向
|
||||||
|
|
||||||
|
// 如果有自定义请求头,则设置请求头
|
||||||
|
if (!empty($custom_headers)) {
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $custom_headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 接受压缩响应
|
||||||
|
curl_setopt($ch, CURLOPT_ENCODING, '');
|
||||||
|
|
||||||
|
// 执行 cURL 请求
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
|
||||||
|
// 检查是否有错误
|
||||||
|
if (curl_errno($ch)) {
|
||||||
|
echo 'cURL 错误: ' . curl_error($ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭 cURL 会话
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
// 尝试解压缩响应数据
|
||||||
|
$decoded_response = @gzdecode($response);
|
||||||
|
if ($decoded_response !== false) {
|
||||||
|
return $decoded_response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回原始响应结果
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function api_request_curl($url, $custom_headers = [], $postData = array())
|
||||||
|
{
|
||||||
|
|
||||||
|
if (empty($url)) return '';
|
||||||
|
$postData = json_encode($postData);
|
||||||
|
|
||||||
|
$curl = curl_init(); //初始化
|
||||||
|
curl_setopt($curl, CURLOPT_URL, $url); //设置url
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); //设置http验证方法
|
||||||
|
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //设置curl_exec获取的信息的返回方式
|
||||||
|
curl_setopt($curl, CURLOPT_POST, 1); //设置发送方式为post请求
|
||||||
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); //设置post的数据
|
||||||
|
// 如果有自定义请求头,则设置请求头
|
||||||
|
// if (!empty($custom_headers)) {
|
||||||
|
// curl_setopt($curl, CURLOPT_HTTPHEADER, $custom_headers);
|
||||||
|
// }
|
||||||
|
|
||||||
|
$array = array_merge($custom_headers, array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Content-Length: ' . strlen($postData))
|
||||||
|
);
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $array);
|
||||||
|
// 接受压缩响应
|
||||||
|
curl_setopt($curl, CURLOPT_ENCODING, '');
|
||||||
|
|
||||||
|
|
||||||
|
$result = curl_exec($curl);
|
||||||
|
if ($result === false) {
|
||||||
|
throw new Exception('Http request message :' . curl_error($curl));
|
||||||
|
}
|
||||||
|
curl_close($curl);
|
||||||
|
// 尝试解压缩响应数据
|
||||||
|
$decoded_response = @gzdecode($result);
|
||||||
|
if ($decoded_response !== false) {
|
||||||
|
return $decoded_response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//// 使用示例
|
||||||
|
//$url = 'https://www.shuote.top:8082/flash/activity/applyActivity';
|
||||||
|
//$custom_post_headers = [
|
||||||
|
// 'Host: www.shuote.top:8082',
|
||||||
|
// 'Connection: keep-alive',
|
||||||
|
// 'Content-Length: 280',
|
||||||
|
// 'Request-Channel: MP-WEIXIN',
|
||||||
|
// 'content-type: application/json',
|
||||||
|
// 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyMDA2NTA2NiwidXNlcklkIjoxOTY0ODg3fQ.bGiCXbvGVGR_E6CHeaNP-XJxnxibrTgKGBvj8Q9HBu0',
|
||||||
|
// 'Accept-Encoding: gzip,compress,br,deflate',
|
||||||
|
// 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.49(0x18003137) NetType/WIFI Language/zh_CN',
|
||||||
|
// 'Referer: https://servicewechat.com/wxbb50595cab69d719/403/page-frame.html'
|
||||||
|
//];
|
||||||
|
//
|
||||||
|
//$post_data = [
|
||||||
|
// "payAmount" => "15.00",
|
||||||
|
// "activityId" => "657373",
|
||||||
|
// "maleCount" => 0,
|
||||||
|
// "femaleCount" => 0,
|
||||||
|
// "payType" => 3,
|
||||||
|
// "hangPeopleDetails" => [],
|
||||||
|
// "groupId" => 1126719,
|
||||||
|
// "applyRemark" => "",
|
||||||
|
// "teamName" => "",
|
||||||
|
// "idNumber" => "",
|
||||||
|
// "birthday" => "",
|
||||||
|
// "xbSex" => null,
|
||||||
|
// "cardType" => 1,
|
||||||
|
// "realName" => "",
|
||||||
|
// "memberRemarkList" => [],
|
||||||
|
// "trackActMemberProjectDoList" => []
|
||||||
|
//];
|
||||||
|
//
|
||||||
|
//$response = curl_post_with_custom_headers($url, $custom_headers, $post_data);
|
||||||
|
//
|
||||||
|
//echo $response;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
// {"payAmount":"15.00","activityId":"657373","maleCount":0,"femaleCount":0,"payType":3,"hangPeopleDetails":[],"groupId":1126719,"applyRemark":"","teamName":"","idNumber":"","birthday":"","xbSex":null,"cardType":1,"realName":"","memberRemarkList":[],"trackActMemberProjectDoList":[]}
|
||||||
|
|
||||||
|
|
||||||
|
//curl 'https://www.shuote.top:8082/flash/activity/applyActivity' -H 'Host: www.shuote.top:8082' -H 'Connection: keep-alive' -H 'Content-Length: 280' -H 'Request-Channel: MP-WEIXIN' -H 'content-type: application/json' -H 'X-Access-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXN0b21QYXJhbWV0ZXIiOiJxd2VyMTIzNCIsImV4cCI6MTcyMDA2NTA2NiwidXNlcklkIjoxOTY0ODg3fQ.bGiCXbvGVGR_E6CHeaNP-XJxnxibrTgKGBvj8Q9HBu0' -H 'Accept-Encoding: gzip,compress,br,deflate' -H 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.49(0x18003137) NetType/WIFI Language/zh_CN' -H 'Referer: https://servicewechat.com/wxbb50595cab69d719/403/page-frame.html' --data '{"payAmount":"15.00","activityId":"657373","maleCount":0,"femaleCount":0,"payType":3,"hangPeopleDetails":[],"groupId":1126719,"applyRemark":"","teamName":"","idNumber":"","birthday":"","xbSex":null,"cardType":1,"realName":"","memberRemarkList":[],"trackActMemberProjectDoList":[]}'
|
||||||
|
|
||||||
Reference in New Issue
Block a user