composer 加载:
"require": {
"php": ">=7.1.0",
"league/oauth2-client": "^2.5",
},
在common/helper中创建
<?php
// +----------------------------------------------------------------------
// | Alpicool [ WE MAKE YOU FEEL COOL ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020-2021
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: dodo
// +----------------------------------------------------------------------
namespace app\common\helper;
use GuzzleHttp\Psr7\Uri;
use League\OAuth2\Client\Provider\GenericProvider;
class Client
{
const SUCCESS = 1;
const ERROR = 0;
const clientId