Skip to content

Commit 39ce11d

Browse files
authored
Update AppEvent.php
修复没有 ToUserName 问题
1 parent d21ad0b commit 39ce11d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Events/AppEvent.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ public function processEventCallback($token, $encodingAesKey) {
9494

9595
$eventRawArr = XmlHelper::xmlToArray($eventRawData);
9696

97-
$corpId = $eventRawArr['ToUserName'];
97+
$corpId = null;
98+
if (isset($eventRawArr['ToUserName'])) {
99+
$corpId = $eventRawArr['ToUserName'];
100+
}
98101
$eventParams = new EventParams();
99102
$eventParams->msg_signature = isset($_GET['msg_signature']) ? $_GET['msg_signature'] : '';
100103
$eventParams->timestamp = $_GET['timestamp'];
@@ -169,4 +172,4 @@ public function callEventReceive(EventReceiveInterface $eventReceive, $eventArr)
169172
return new AppEventResult(AppEventResult::TYPE_EVENT, $this->getProcessEventSuccessResult(), $result);
170173
}
171174

172-
}
175+
}

0 commit comments

Comments
 (0)