myclassphp/wxlogin

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

myclassphp wechat login

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/myclassphp/wxlogin

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

This package is auto-updated.

Last update: 2025-12-07 18:34:06 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();