Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liqiao committed Sep 24, 2015
1 parent 32d3264 commit e7079b0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions receive.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$crypt = new DingtalkCrypt(TOKEN, ENCODING_AES_KEY, SUITE_KEY);

$msg = "";
$res = "success";
$errCode = $crypt->DecryptMsg($signature, $timeStamp, $nonce, $encrypt, $msg);
if ($errCode == 0)
{
Expand All @@ -31,6 +32,11 @@
{
//handle auth change event
}
else if ("check_update_suite_url" === $eventType)
{
$res = $eventMsg->Random;
$testSuiteKey = $eventMsg->TestSuiteKey;
}
else
{
//should never happen
Expand All @@ -41,9 +47,8 @@
Log::e(json_encode($_GET) . " ERR:" . $errCode);
}

$plain = "success";
$encryptMsg = "";
$errCode = $crypt->EncryptMsg($plain, $timeStamp, $nonce, $encryptMsg);
$errCode = $crypt->EncryptMsg($res, $timeStamp, $nonce, $encryptMsg);
if ($errCode == 0)
{
echo $encryptMsg;
Expand Down

0 comments on commit e7079b0

Please sign in to comment.