public function index() { /* 加载微信SDK */ import('Com.ThinkWechat'); $Wechat = D('Wechat', 'Service'); $weixin = new \ThinkWechat('chenjianxiang'); $data = $weixin->request(); list($content, $type) = $Wechat->reply($data); $weixin->response($content, $type); $this->display(); }
public function index() { /* 加载微信SDK */ import('ORG.Net.ThinkWechat'); $weixin = new ThinkWechat('weixin'); /* 获取请求信息 */ $data = $weixin->request(); /* 获取回复信息 */ // 这里的回复信息是通过判断请求内容自行定制的, 不在 SDK范围内,请自行完成 list($content, $type) = $this->reply($data); /* 响应当前请求 */ $weixin->response($content, $type); }
public function index() { /* 加载微信SDK */ import("@.ORG.Util.ThinkWechat"); $weixin = new ThinkWechat(); /* 获取请求信息 */ $data = $weixin->request(); /* 获取回复信息 */ list($content, $type) = $this->reply($data); // 接收到的信息入不同的库 $this->weichatlog($data); /* 响应当前请求 */ $weixin->response($content, $type); }