superzc / qqconnect
1.0.1
2023-12-13 10:06 UTC
README
此包为 Laravel 框架提供额外的功能。
安装
您可以通过 composer 安装此包。
composer require superzc/qqconnect
使用
修改 QQ 互联配置文件 config/qqconnect.php
return [ 'appid' => 'xxx', 'appkey' => 'xxx', 'callback' => 'https://example.com/qc_redirect.html', ];
调用类方法
use Superzc\QQConnect\QQConnect; use Superzc\QQConnect\Exceptions\DefaultException as QCException; try { $qqconnect = new QQConnect(); $qqconnect->init($openid, $access_token); $result = $qqconnect->doSomething(); } catch (MPDefaultException $e) { return response()->json([ 'ret' => $e->getCode(), 'msg' => $e->getMessage(), ]); }
使用门面
use Superzc\QQConnect\Facades\QQConnect; try { QQConnect::init($openid, $access_token); $result = QQConnect::doSomething(); } catch (QCException $e) { return response()->json([ 'ret' => $e->getCode(), 'msg' => $e->getMessage(), ]); }
变更日志
暂无