/** * 通过授权获取用户 * * @param string $to * @param string $state * @param string $scope * * @return Bag | null */ public function authorize($to = null, $scope = 'snsapi_base', $state = 'STATE') { if (!$this->input->has('state') && !$this->input->has('code')) { $this->redirect($to, $scope, $state); } return $this->user(); }
/** * 处理微信的请求 * * @return mixed */ protected function handleRequest() { $this->call('received', array($this->input)); if ($this->input->has('MsgId')) { return $this->handleMessage($this->input); } elseif ($this->input->has('MsgType') && $this->input->get('MsgType') === 'event') { return $this->handleEvent($this->input); } return false; }
/** * 处理微信的请求 * * @return mixed */ protected function handleRequest() { if ($this->input->has('MsgId')) { return $this->handleMessage($this->input); } else { if ($this->input->has('MsgType') && $this->input('MsgType') == 'event') { return $this->handleEvent($this->input); } } return false; }