myclassphp/wxlogin

There is no license information available for the latest version (dev-master) of this package.

myclassphp wechat login

Maintainers

Package info

github.com/a1586256143/myclassphp-wxlogin

pkg:composer/myclassphp/wxlogin

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2021-07-07 08:52 UTC

This package is auto-updated.

Last update: 2026-03-07 19:08:43 UTC


README

根据code获取用户信息

require_once 'vendor/autoload.php';
$appid = '';
$appSecret = '';
$app = new system\WxLogin($appid , $appSecret);
$user = $app->getUserInfo($_GET['code']);
var_dump($user);

发起授权并拿到授权信息

require_once 'vendor/autoload.php';
$appid = '';
$appSecret = '';
$app = new system\WxLogin($appid , $appSecret);
if (isset($_GET['code']) && $_GET['state']){
    $user = $app->getUserInfo($_GET['code']);
    if (!$user) exit($app->getError());
    var_dump($user);
    exit();
}
echo $app->auth();