应用开启聊天记录查询签名,根据文档获取应用内所有聊天记录2 ,实现如下
$time=time()*1000;
$url="https://leancloud.cn/1.1/rtm/messages/logs";
$sign= md5($time.$appKey).",".$time;
$headers=[
'X-LC-Id: '.$appId,
'X-LC-Sign: '.$sign,
'Content-Type: application/json'
];
list($code,$result)=sendPost($url,$headers,'','GET');
print_r($result); //1
echo "*********************************************************************\n";
$sign= md5($time.$appSecret).",".$time.",master";
$headers=[
'X-LC-Id: '.$appId,
'X-LC-Sign: '.$sign,
'Content-Type: application/json'
];
list($code,$result)=sendPost($url,$headers,'','GET');
print_r($result); //2
结果,在未开启聊天记录查询签名认证下,1,2都可返回数据。在开启的情况下,1,2均提示签名错误,可是根据上述文档2应该正确返回数据。
-
创建时间
15年12月13日
-
最后回复
15年12月16日
-
7
回复
-
1.2K
浏览
-
4
用户
-
2
链接