Merge branch 'feature/choose' into 'master'

choose config

See merge request arch/php-auth-client!1
This commit is contained in:
董巍 2018-11-23 14:22:56 +08:00
commit e5648a557c

View File

@ -18,11 +18,24 @@ class OAuth
$this->secret = $config['secret'];
}
/**
* 选择配置 应对同一项目引入多个pdauth
* @param $config
*/
public function choose($config)
{
$this->host = $config['host'];
$this->id = $config['appid'];
$this->secret = $config['secret'];
}
/**
* 生成授权的链接
* @param $redirect
* @return string
*/
public function connect($redirect)
{
$redirect = urlencode($redirect);