/
gsjlx.php
executable file
·35 lines (33 loc) · 1.26 KB
/
gsjlx.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
include "wechat.class.php";
include "./controller/textController/TextController.php";
include "./controller/eventController/EventController.php";
include "./model/TextModel.php";
include "./model/EventModel.php";
include "./config/params.php";
$options = array(//填入你的公众号信息
'token' => '',
'encodingaeskey'=>'',
'appid'=>'',
'appsecret'=>''
);
$weObj = new Wechat($options);
$weObj->valid();
$type = $weObj->getRev()->getRevType();
switch($type) {
case Wechat::MSGTYPE_TEXT:
$textObj = new TextController($weObj);
$reply = $textObj->replyIndex();
$weObj->text($reply)->reply();
break;
case Wechat::MSGTYPE_EVENT:
$eventObj = new EventController($weObj);
$reply = $eventObj->replyIndex();
//$weObj->text($reply)->reply();
$weObj->news($reply)->reply();
break;
case Wechat::MSGTYPE_IMAGE:
break;
default:
$weObj->text("help info")->reply();
}