/** * 刷新二维码的token */ private function _refresh() { set_time_limit(30); //防止出现异常导致PHP超时从而引发前端无响应。 $resource = $this->getResource(); $act = $_GET['act']; $token = Service_Func::newTokenFor($act); $ret = array('errno' => '0', 'data' => array('token' => $token)); echo json_encode($ret, JSON_UNESCAPED_UNICODE); return true; }
public function checkin($act, $token) { $openId = self::$resource['FromUserName']; $nickname = Data_Wechat_User::getNick($openId); $avatar = Data_Wechat_User::getAvatar($openId); Vera_Autoload::changeApp('rollcall'); $service = new Service_Func(); $checkin = $service->checkin($act, $token, $openId, $nickname); Vera_Autoload::reverseApp(); if ($checkin['errno']) { $ret['type'] = 'text'; $ret['data']['Content'] = $checkin['errmsg']; return $ret; } $data = array('a' => $avatar, 'n' => $nickname); $ret['type'] = 'news'; $temp['Articles'][0]['Title'] = "您是第{$checkin['rank']}位在【{$checkin['actInfo']['name']}】签到"; $temp['Articles'][0]['Description'] = "点击大图参与大屏幕弹幕互动。"; $temp['Articles'][0]['PicUrl'] = 'http://www.novaxmu.cn/templates/rollcall/img/success.png'; $temp['Articles'][0]['Url'] = 'http://hackathontsubaki.github.io/Frontend/client.html?' . http_build_query($data); // Vera_Log::addNotice('url', $temp['Articles'][0]['Url']); $temp['Articles'][1]['Title'] = "SegmentFault"; $temp['Articles'][1]['PicUrl'] = 'http://tp1.sinaimg.cn/2036070420/180/40003289296/0'; $temp['Articles'][1]['Url'] = 'segmentfault.com'; $temp['Articles'][2]['Title'] = "FreesFund | 峰瑞资本"; $temp['Articles'][2]['PicUrl'] = 'http://freesvc.com/favicon.0bf61f76.ico'; $temp['Articles'][2]['Url'] = 'http://freesvc.com/'; $temp['Articles'][3]['Title'] = "有赞"; $temp['Articles'][3]['PicUrl'] = 'http://static.segmentfault.com/app/hackathon-2015/logos/youzan.8bf6b2b.png'; $temp['Articles'][3]['Url'] = 'https://www.youzan.com/'; $temp['Articles'][4]['Title'] = "TalkingData"; $temp['Articles'][4]['PicUrl'] = 'http://segmentfault.com/img/bVp4TP'; $temp['Articles'][4]['Url'] = 'https://www.talkingdata.com/'; $temp['Articles'][5]['Title'] = "阿里百川"; $temp['Articles'][5]['PicUrl'] = 'http://static.segmentfault.com/app/hackathon-2015/logos/baichuan.cabac3c0.png'; $temp['Articles'][5]['Url'] = 'https://baichuan.taobao.com/'; $ret['data'] = $temp; return $ret; }