wang hou sheng 10 months ago
parent 0dacbff7d2
commit bd1e98e33e
  1. 7
      app/api/controller/Wxserver.php

@ -74,7 +74,10 @@ class Wxserver extends BaseController
$model->update($up, ['appid' => $appid]); $model->update($up, ['appid' => $appid]);
} }
echo 'success'; 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); echo $this->responseText($data);
} }
} }
@ -92,7 +95,7 @@ class Wxserver extends BaseController
</xml>"; </xml>";
$fromUser = $data['ToUserName']; $fromUser = $data['ToUserName'];
$toUser = $data['FromUserName']; $toUser = $data['FromUserName'];
$content = !empty($data['Content']) ? $data['Content'] : '收到你的信息了'; $content = !empty($data['Content']) ? $data['Content'] : 'success';
$time = time(); $time = time();
$msgType = 'text'; $msgType = 'text';
return sprintf($template, $toUser, $fromUser, $time, $msgType, $content); return sprintf($template, $toUser, $fromUser, $time, $msgType, $content);

Loading…
Cancel
Save