收藏
回答

企业微信应用验证URL失败


代码:


include_once "/vendor/weworkapi/callback/WXBizMsgCrypt.php";

$token  = "YmEc";
$corpId = "wwd4099530cxxxx";
$encodingAesKey = "emvOcYJBT3SVLGbzeYxHbg9HobQW5S448W85kRDaaa";
// 需要返回的明文
$sEchoStr = "";
$wxcpt = new \WXBizMsgCrypt($token, $encodingAesKey, $corpId);

$sVerifyMsgSig = $_GET["msg_signature"];
$sVerifyTimeStamp = $_GET["timestamp"];
$sVerifyNonce = $_GET["nonce"];
$sVerifyEchoStr = $_GET["echostr"];
$errCode = $wxcpt->VerifyURL($sVerifyMsgSig, $sVerifyTimeStamp, $sVerifyNonce, $sVerifyEchoStr, $sEchoStr);
file_put_contents('aaaa.txt',$sEchoStr, FILE_APPEND );
file_put_contents('aaaa.txt',$errCode, FILE_APPEND);

if ($errCode == 0)
{
   echo $sEchoStr;
} else {
   print("ERR: " . $errCode . "\n\n");
}




我在日志中获取到返回的$errCode = 0的,但是$sEchoStr 却是空的

请问大家的$sEchoStr是什么样的呢?在验证的时候老是无法通过




回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容
问题标签