diff --git a/app/api/controller/Wxserver.php b/app/api/controller/Wxserver.php index d9d01abf..1fc755a6 100644 --- a/app/api/controller/Wxserver.php +++ b/app/api/controller/Wxserver.php @@ -74,7 +74,10 @@ class Wxserver extends BaseController $model->update($up, ['appid' => $appid]); } echo 'success'; - } elseif ($data['MsgType'] == 'text') { + } elseif ($data['MsgType'] == 'text' && !empty($data['Content'])) { + if ($data['Content'] == 'TESTCOMPONENT_MSG_TYPE_TEXT') { + $data['Content'] = 'TESTCOMPONENT_MSG_TYPE_TEXT_callback'; + } echo $this->responseText($data); } } @@ -92,7 +95,7 @@ class Wxserver extends BaseController "; $fromUser = $data['ToUserName']; $toUser = $data['FromUserName']; - $content = !empty($data['Content']) ? $data['Content'] : '收到你的信息了'; + $content = !empty($data['Content']) ? $data['Content'] : 'success'; $time = time(); $msgType = 'text'; return sprintf($template, $toUser, $fromUser, $time, $msgType, $content);