删除验证数据
@param string $appid 如在类初始化时已提供，则可为空
@return bool
163430
public function resetAuth($appid = '')
    {
        $authname = 'wechat_access_token_' . (empty($appid) ? $this->appid : $appid);
        Tools::log("Reset Auth And Remove Old AccessToken.", "MSG - {$this->appid}");
        $this->access_token = '';
        Tools::removeCache($authname);
        return true;
    }
1316600
public function findKYCById($appUserId, $id)
    {
        $url = sprintf('users/%s/kyc/%s', $appUserId, $id);
        return $this->getOne($url, $this->KYCEntityClassName);
    }
1296777
protected function checkAllowFields($append = [])
    {
        // 检测字段
        if (empty($this->field) || true === $this->field) {
            $query = $this->db(false);
            $table = $this->table ?: $query->getTable();

            $this->field = $query->getConnection()->getTableFields($table);

            $field = $this->field;
        } else {
            $field = array_merge($this->field, $append);

            if ($this->autoWriteTimestamp) {
                array_push($field, $this->createTime, $this->updateTime);
            }
        }

        if ($this->disuse) {
            // 废弃字段
            $field = array_diff($field, (array) $this->disuse);
        }
        return $field;
    }
50523
public function getKFSession($openid)
    {
        if (!$this->access_token && !$this->getAccessToken()) {
            return false;
        }
        $result = Tools::httpGet(self::API_BASE_URL_PREFIX . self::CUSTOM_SESSION_GET . "access_token={$this->access_token}" . '&openid=' . $openid);
        if ($result) {
            $json = json_decode($result, true);
            if (empty($json) || !empty($json['errcode'])) {
                $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505';
                $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解析接口返回内容！';
                return $this->checkRetry(__FUNCTION__, func_get_args());
            }
            return $json;
        }
        return false;
    }
968318
public function encrypt($text, $appId)
    {
        try {
            //获得16位随机字符串，填充到明文之前
            $key    = $this->getAESKey();
            $random = $this->getRandomStr();
            $text   = $this->encode($random . pack('N', strlen($text)) . $text . $appId);

            $iv = substr($key, 0, 16);

            $encrypted = openssl_encrypt($text, 'aes-256-cbc', $key, OPENSSL_RAW_DATA | OPENSSL_NO_PADDING, $iv);

            //print(base64_encode($encrypted));
            //使用BASE64对加密后的字符串进行编码
            return [ErrorCode::$OK, base64_encode($encrypted)];
        } catch (Exception $e) {
            //print $e;
            return [ErrorCode::$EncryptAESError, null];
        }
    }
1119217
public function GetSchemaForGame($appId)
    {
        // Set up the api details
        $this->method  = __FUNCTION__;
        $this->version = 'v0002';

        // Set up the arguments
        $arguments = [
            'appid' => $appId,
            'l'     => 'english',
        ];

        // Get the client
        $client = $this->setUpClient($arguments);

        return $client;
    }
1049395
public static function getProducer($appId = Producer::DEFAULT_APP_ID)
    {
        if (null === $appId) {
            $appId = Producer::DEFAULT_APP_ID;
        }

        if (!array_key_exists($appId, static::$producers)) {

            if (array_key_exists($appId, static::$builders)) {
                $func = static::$builders[$appId];
                static::addProducer($func($appId));
                unset(static::$builders[$appId]);

                return static::getProducer($appId);
            }

            throw new Exception\FacadeException("Producer with appId: '{$appId}' not exists yet!");
        }

        return static::$producers[$appId];
    }
1097306
public function getById($appId, array $queryParams = [])
    {
        $response = $this->api->applications()->getById($appId, $queryParams);

        return new ApplicationResponse($response);
    }
67280
public function getAll($appId = null, array $queryParams = [])
    {
        $response = $this->api->applications()->scans()->getAll($appId, $queryParams);

        return new ScansResponse($response);
    }
859606
public function unbindFrom(string $openAppId)
    {
        $params = [
            'appid' => $this->app['config']['app_id'],
            'open_appid' => $openAppId,
        ];

        return $this->httpPostJson('cgi-bin/open/unbind', $params);
    }
221707
public function info($appId) {
        $data = $this->getInfo()->parameters([
            'authorizer_appid' => $appId
        ])->json();
        if (!array_key_exists('authorizer_info', $data)) {
            throw new \Exception('INFO ERROR!');
        }
        $this->set($data['authorizer_info']);
        return $data['authorizer_info'];
    }
1036877
public function GetPlayerAchievementsAPI($appId)
    {
        // Set up the api details
        $this->method  = 'GetPlayerAchievementsAPI';
        $this->version = 'v0001';

        // Set up the arguments
        $arguments = [
            'steamid' => $this->steamId,
            'appid'   => $appId,
            'l'       => 'english',
        ];

        // Get the client
        $stats = $this->GetSchemaForGame($appId);

        // Make sure the game has achievements
        if ($stats == null || $stats->game->availableGameStats->achievements == null) {
            return null;
        }

        $client = $this->setUpClient($arguments)->playerstats;
        $stats  = $stats->game->availableGameStats->achievements;

        // Clean up the games
        $achievements = $this->convertToObjects($client->achievements, $stats);

        return $achievements;
    }
564109
public function existsApplyId($applyId)
    {
        $qb = $this->createQueryBuilder();
        $qb->hydrate(false)
           ->select('applyId')
           ->field('applyId')->equals($applyId);
           
        $result = $qb->getQuery()->execute();
        $count = $result->count();
        return (bool) $count;
    }
90737
public function getAll($appId = null, array $queryParams = [])
    {
        $response = $this->api->applications()->profiles()->getAll($appId, $queryParams);

        return new ProfilesResponse($response);
    }
1056763
public static boolean isRoot(String appid) {
		return StringUtils.equals(id(Config.getRootAppIdentifier()), id(appid));
	}
1176150
public function getSiteInfo(int $appId) : array
    {
        Assert::that($appId)->greaterThan(0, 'The $appId has to be positive');
        return (array)$this->master->doRequest(
            'GET',
            sprintf(
                '/admin/WEBAPI/Endpoints/v1_0/PluginService/{KEY}/SiteInfo/%s',
                $appId
            )
        );
    }
1035007
public function getAccessToken($appid = '', $appsecret = '', $token = '')
    {
        if (!$appid || !$appsecret) {
            list($appid, $appsecret) = array($this->appid, $this->appsecret);
        }
        if ($token) {
            return $this->access_token = $token;
        }
        $cache = 'wechat_access_token_' . $appid;
        if (($access_token = Tools::getCache($cache)) && !empty($access_token)) {
            return $this->access_token = $access_token;
        }
        # 检测事件注册
        if (isset(Loader::$callback[__FUNCTION__])) {
            return $this->access_token = call_user_func_array(Loader::$callback[__FUNCTION__], array(&$this, &$cache));
        }
        $result = Tools::httpGet(self::API_URL_PREFIX . self::AUTH_URL . 'appid=' . $appid . '&secret=' . $appsecret);
        if ($result) {
            $json = json_decode($result, true);
            if (!$json || isset($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                Tools::log("Get New AccessToken Error. {$this->errMsg}[{$this->errCode}]", "ERR - {$this->appid}");
                return false;
            }
            $this->access_token = $json['access_token'];
            Tools::log("Get New AccessToken Success.", "MSG - {$this->appid}");
            Tools::setCache($cache, $this->access_token, 5000);
            return $this->access_token;
        }
        return false;
    }