Exemplo n.º 1
0
 /**
  * 通过授权获取用户
  *
  * @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();
 }
Exemplo n.º 2
0
 /**
  * 处理微信的请求
  *
  * @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;
 }
Exemplo n.º 3
0
 /**
  * 处理微信的请求
  *
  * @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;
 }