Esempio n. 1
0
 /**
  * 生成outh URL
  *
  * @param string $to
  * @param string $scope
  * @param string $state
  *
  * @return string
  */
 public function url($to = null, $scope = 'snsapi_userinfo', $state = 'STATE')
 {
     $to !== null || ($to = Url::current());
     $params = array('appid' => $this->appId, 'redirect_uri' => $to, 'response_type' => 'code', 'scope' => $scope, 'state' => $state);
     return self::API_URL . '?' . http_build_query($params) . '#wechat_redirect';
 }
Esempio n. 2
0
File: Js.php Progetto: pakey/weixin
 /**
  * 获取当前URL.
  *
  * @return string
  */
 public function getUrl()
 {
     if ($this->url) {
         return $this->url;
     }
     return Url::weixin();
 }