myclassphp / wxlogin
myclassphp wechat login
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/myclassphp/wxlogin
Requires
- overtrue/wechat: ~4.0
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();