卓易健康PHP步数接口
本帖最后由 丸子吃枣药丸 于 2019-11-20 21:02 编辑:lol 随便搞个空间什么的都能运行起来
大家赏个币
<?php
header("Content-type: text/html; charset=utf-8");
ini_set('date.timezone','Asia/Shanghai');
function shua($user,$walk){
$timeStamp = time();
$str = "8061FD";
$data = md5($user.$str.$timeStamp);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://weixin.droi.com/health/phone/index.php/SendWechat/getWxOpenid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "accountId={$user}&timeStamp={$timeStamp}&sign={$data}",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
$response = json_decode($response,true);
if($response["code"] != 0){
$response["code"] = 1000;
die(json_encode($response));
}
$data1 = md5($user.$str.$walk.$str.$timeStamp.$str.$response["openid"]);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://weixin.droi.com/health/phone/index.php/SendWechat/stepSubmit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "accountId={$user}&jibuNuber={$walk}&timeStamp={$timeStamp}&sign=$data1",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
$response = json_decode($response,true);
if($response['errcode'] != 0 || $response['msg'] != "" || $response["code"] != 0){
$response["code"] = 1000;
die(json_encode($response));
}
$response["code"] = 1000;
echo json_encode($response);
}
if(!isset($_REQUEST["user"]) || !isset($_REQUEST["walk"])){
die(json_encode(["code" => 1000,"msg" => "参数不全"]));
}
$user = htmlspecialchars($_REQUEST["user"]);
$walk = htmlspecialchars($_REQUEST["walk"]);
shua($user,$walk);
懂的自己拿函数
不懂上传空间后 直接访问 http://域名/文件名.php?user=卓易健康用户名&walk=步数
-1 是 98800
陈数牛逼
陈数牛逼
陈数牛逼
翦珂义牛逼
翦珂义牛逼
翦珂义牛逼 好像已经凉凉了 是直接走的官方嘛 是官方的吗 感谢分享 PHP是世界上最好的语言! 绑定设备失败是什么原因呢? 凉凉凉凉 已经不可用了好像。
提交后 页面getWxOpenid:为空。。。。这个是微信改了接口吗?怎么解决?
页:
[1]
2