获取公众号的黑名单列表
@param string $begin_openid
@return array
@throws Exceptions\InvalidResponseException
@throws Exceptions\LocalCacheException
509731
public function getBlackList($begin_openid = '')
    {
        $url = "https://api.weixin.qq.com/cgi-bin/tags/members/getblacklist?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['begin_openid' => $begin_openid]);
    }
1200505
public function getUserInfo($openid){
        if (!$this->access_token && !$this->checkAuth()) return false;
        $result = $this->http_get(self::API_URL_PREFIX.self::USER_INFO_URL.'access_token='.$this->access_token.'&openid='.$openid);
        if ($result)
        {
            $json = json_decode($result,true);
            if (isset($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            return $json;
        }
        return false;
    }
1264151
public String getGroupIdByOpenid(String openid) {
        BeanUtil.requireNonNull(openid, "openid is null");
        LOG.debug("通过关注者ID获取所在分组信息.....");
        String result = null;
        String url = BASE_API_URL + "cgi-bin/groups/getid?access_token=#";
        Map<String, String> params = new HashMap<String, String>();
        params.put("openid", openid);
        BaseResponse r = executePost(url, JSONUtil.toJson(params));
        if (isSuccess(r.getErrcode())) {
            result = JSONUtil.toMap(r.getErrmsg()).get("groupid").toString();
        }
        return result;
    }
1344135
public function getMemberInfo($openId, $lang = 'zh_CN')
    {
        $result = $this->httpGet(self::WECHAT_MEMBER_INFO_URL . 'access_token=' . $this->getAccessToken(), [
            'openid' => $openId,
            'lang' => $lang
        ]);
        return !isset($result['errcode']) ? $result : false;
    }
532489
public function getUserInfo($openId)
    {
        return $this->auth(function () use ($openId) {
            // 1. 调用接口,获取用户信息
            $userInfo = $this->http([
                'url' => 'https://api.weixin.qq.com/cgi-bin/user/info',
                'data' => [
                    'access_token' => $this->accessToken,
                    'openid' => $openId,
                    'lang' => 'zh_CN',
                ],
            ]);

            // 2. 处理微信可能返回错误JSON的情况
            $responseText = $userInfo->getResponseText();
            $response = json_decode($responseText, true);

            // 有的用户会返回错误的JSON格式,导致PHP出现JSON_ERROR_CTRL_CHAR错误
            // {"subscribe":1,"openid":"o0Mh3tzELt7MrnjqRlzNJ9SXNgMg","nickname":"dyx","sex":2,"language":"zh_CN","city":"bý","province":"VÛ]Ý","country":"","headimgurl":"http:\/\/wx.qlogo.cn\/mmopen\/4ibDOGnEicR5lJbicvZOD5Lonvu3kMYphDMJByD9UYCMOzCXwdVxzDpvnlhJJqjDichASpHUYjd51lLNXicoPdib6ibNnxpsUbFgPN3\/0","subscribe_time":1391064765}
            if ($response === null && json_last_error() !== JSON_ERROR_NONE) {
                // 删除返回数据中的错误控制符
                $responseText = preg_replace('/[\x00-\x1F\x7F]/', '', $responseText);
                $response = json_decode($responseText, true);
            }

            // 3. 如果仍然解析不出来,确实是数据错误
            if ($response === null) {
                throw new \Exception('返回不是有效的JSON数据,数据是' . $userInfo->getResponseText(), -1);
            }

            // 4. 将解析成功的数据,设置回去
            $userInfo->setOption('response', $response);

            return $userInfo;
        });
    }
184159
public function getUserInfo(string $openId, string $lang = 'zh_CN')
    {
        return $this->curl->get(self::GET.$this->access_token.'&'.http_build_query([
                    'openid' => $openId,
                    'lang' => $lang,
                ]
            ));
    }
780472
public function typing($openid, $command = 'Typing')
    {
        $url = "https://api.weixin.qq.com/cgi-bin/message/custom/typing?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['touser' => $openid, 'command' => $command]);
    }
585050
public function signature ( $request, $base_string, $consumer_secret, $token_secret )
	{
		// Fetch the private key cert based on the request
		$cert = $this->fetch_private_cert($request);
		
		// Pull the private key ID from the certificate
		$privatekeyid = openssl_get_privatekey($cert);
		
		// Sign using the key
		$sig = false;
		$ok  = openssl_sign($base_string, $sig, $privatekeyid);   
		
		// Release the key resource
		openssl_free_key($privatekeyid);
		  
		return $request->urlencode(base64_encode($sig));
	}
839284
public function tryConditional($openid)
    {
        $url = "https://api.weixin.qq.com/cgi-bin/menu/trymatch?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['user_id' => $openid]);
    }
824456
public function getOauthUserinfo($access_token,$openid){
        $result = $this->http_get(self::API_BASE_URL_PREFIX.self::OAUTH_USERINFO_URL.'access_token='.$access_token.'&openid='.$openid);
        if ($result)
        {
            $json = json_decode($result,true);
            if (!$json || !empty($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            return $json;
        }
        return false;
    }
1025243
public function getCardList($openid, $card_id = null)
    {
        $data = ['openid' => $openid];
        is_null($card_id) || $data['card_id'] = $card_id;
        $url = "https://api.weixin.qq.com/card/user/getcardlist?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
348385
public static BaseResult auth(String access_token,String openid){
		HttpUriRequest httpUriRequest = RequestBuilder.get()
				.setUri(BASE_URI + "/sns/auth")
				.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(access_token))
				.addParameter("openid", openid)
				.build();
		return LocalHttpClient.executeJsonResult(httpUriRequest,BaseResult.class);
	}
606384
public function getCardMemberCardDetail($begin_date, $end_date, $card_id)
    {
        $data = ['begin_date' => $begin_date, 'end_date' => $end_date, 'card_id' => $card_id];
        $url = "https://api.weixin.qq.com/datacube/getcardmembercarddetail?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
819290
public function list(int $begin, int $count)
    {
        $params = [
            'begin' => $begin,
            'count' => $count,
        ];

        return $this->httpPostJson('shakearound/device/group/getlist', $params);
    }
302014
public function end($beginId)
    {
        if ($this->nowAffairId == $beginId) {
            $this->nowAffairId = 0;
        } else {
            return false;
        }
        //邮箱中有消息
        if (count($this->mailbox) > 0) {
            while (true) {
                if (count($this->mailbox) == 0) break;
                $data = array_shift($this->mailbox);
                $this->handle($data);
                if ($data['call'] == "begin") {
                    break;
                }
            }
        }
        return true;
    }
439915
public function getSnsUserInfo($openId, $oauth2AccessToken, $lang = 'zh_CN')
    {
        $result = $this->httpGet(self::WEHCAT_SNS_USER_INFO_PREFIX, [
            'access_token' => $oauth2AccessToken,
            'openid' => $openId,
            'lang' => $lang
        ]);
        return !array_key_exists('errcode', $result) ? $result : false;
    }
54530
public function getUserInfo($openid, $lang = 'zh_CN')
    {
        $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid={$openid}&lang=zh_CN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpGetForJson($url);
    }