choose config

This commit is contained in:
dongwei 2018-11-23 14:10:30 +08:00
parent dbd29c82fd
commit 2d905e35a2

View File

@ -18,11 +18,24 @@ class OAuth
$this->secret = $config['secret']; $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 * @param $redirect
* @return string * @return string
*/ */
public function connect($redirect) public function connect($redirect)
{ {
$redirect = urlencode($redirect); $redirect = urlencode($redirect);