Esempio n. 1
0
 /**
  * @param string $redirectUrl 授权后重定向的回调链接地址,请使用urlencode对链接进行处理
  * @param string $state 重定向后会带上state参数,开发者可以填写a-zA-Z0-9的参数值,最多128字节
  * @param string $scope 应用授权作用域
  * @return string
  */
 public function getCodeUrl($redirectUrl, $state = null, $scope = OAuthScope::BASE)
 {
     $params = ['appid' => $this->appId, 'redirect_uri' => $redirectUrl, 'response_type' => 'code', 'scope' => $scope, 'state' => $state ? $state : time()];
     $url = PhalconPlusUtil::UrlAddParams(self::urlCode, $params);
     return $url . '#wechat_redirect';
 }