khs1994/qq-login

dev-master 2018-02-21 10:31 UTC

This package is auto-updated.

Last update: 2022-05-12 14:02:17 UTC


README

GitHub stars StyleCI PHP from Packagist GitHub (pre-)release

安装

$ composer require khs1994/qq-login @dev

使用方法

<?php

require 'vendor/autoload.php';

use QQLogin\QQLogin;

$config = [
    'appid' => '8888...',
    'appkey' => 'XXXX...',
    'callback' => 'http://demo.khs1994.com/tests/callback.php',
    'scope' => 'get_user_info',
    'errorReport' => true,
];

$qq = new QQLogin($config);

# 请求 QQ 登录页

$qq->getLoginUrl();

# 回调地址中再次请求密钥

$access_token = $qq->getAccessToken();

$openid = $qq->getOpenId();

# 通过密钥等获取用户信息,返回数组

$array = $qq->call->get_user_info();

示例

请查看 index.php

感谢