コード例 #1
0
ファイル: AuthBiz.php プロジェクト: shoaly/wechat-biz
 /**
  * 通过授权获取用户
  *
  * @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();
 }
コード例 #2
0
ファイル: Server.php プロジェクト: nutsdo/rp-wechat
 /**
  * 处理微信的请求
  *
  * @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;
 }
コード例 #3
0
ファイル: Wechat.php プロジェクト: xutongtong/wechat
 /**
  * 处理微信的请求
  *
  * @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;
 }