<?php
class WeixinAction extends Action{
public function index(){
$token=I('token','','trim');
//写入到用户表中对应
//$this->write_member($token);
/* 加载微信SDK */
import('Com.ThinkWechat');
//$token=I('token','','trim');
if($token=="")
{
$weixin = new ThinkWechat('weixin');
}
else
{
$weixin=new ThinkWechat($token);
}
/* 获取请求信息 */
$data = $weixin->request();
error_log(print_r(TOKEN)."\r\n", 4, "/home/www/weixinau/log2.txt");
/* 获取回复信息 */
// 这里的回复信息是通过判断请求内容自行定制的,不在 SDK范围内,请自行完成
list($content, $type) = $this->reply($data);
/* 响应当前请求 */
$weixin->response($content, $type);
}
最佳答案
