gsx / oauthconnect
Third-pary login ,support WeChat,qq,weibo,baidu,gitee,github etc.
dev-master
2019-07-11 03:15 UTC
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2025-06-11 16:30:52 UTC
README
QQ、微信、微博、Github、Gitee、百度等第三方登陆
使用
安装composer包
- composer require gsx/oauthconnect dev-master (推荐)
- 下载源码 https://github.com/EricGSX/OauthConnect.git
定义自动加载
- composer下载不需要单独配置
- 源码下载需要修改项目composer.json文件
"files": [
"vendor/OauthConnect/autoload.php"
]
授权页面调用
use Oauthconnect\GuoOauth;
$obj = new GuoOauth($config); # config配置可参照配置文件,不建议直接修改扩展,可动态配置
$obj->setPlatForm('github');
obj->authCode();
回调页面调用
use Oauthconnect\GuoOauth;
$obj = new GuoOauth($config); # 也可以使用$obj->setConfig($config);
$userinfo = $obj->userinfo();