From 668aca97c84a9083e8f0d8c8948aa5e28461d110 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 1 Apr 2013 10:56:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4Oauth=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E5=8C=96=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Think/Oauth.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Think/Oauth.php b/Think/Oauth.php index cf64b8a1..5ee587b4 100644 --- a/Think/Oauth.php +++ b/Think/Oauth.php @@ -12,7 +12,7 @@ namespace Think; // oauth登录接口 // -// Oauth::connect(['oauth_type'=>'qq','app_key'=>'','app_secret'=>'','callback'=>'','authorize'=>'']); // 链接QQ登录 +// Oauth::connect('qq',['app_key'=>'','app_secret'=>'','callback'=>'','authorize'=>'']); // 链接QQ登录 // Oauth::login(); // 跳转到授权登录页面 或者 Oauth::login($callbackUrl); // Oauth::call('api','params'); // 调用API接口 // @@ -28,18 +28,17 @@ class Oauth { /** * 连接oauth * @access public + * @param string $type Oauth类型 * @param array $options 配置数组 * @return object */ - static public function connect($options=[]) { - $type = $options['oauth_type']; + static public function connect($type,$options=[]) { $class = 'Think\\Oauth\\Driver\\'.ucwords($type); if(class_exists($class)) { - unset($options['oauth_type']); self::$handler = new $class($options); return self::$handler; }else{ - Error::halt('_CACHE_TYPE_INVALID_:'.$type); + E('_OAUTH_TYPE_INVALID_:'.$type); } }