diff --git a/Think/Oauth.php b/Think/Oauth.php index 619c0521..cf64b8a1 100644 --- a/Think/Oauth.php +++ b/Think/Oauth.php @@ -53,12 +53,17 @@ class Oauth { self::$handler->getAccessToken(); } + // 设置保存过的token信息 + static public function setToken($token){ + self::$handler->setToken($token); + } + // 获取oauth用户信息 static public function getOauthInfo(){ return self::$handler->getOauthInfo(); } - // 获取oauth用户信息 + // 获取openid信息 static public function getOpenId(){ return self::$handler->getOpenId(); } diff --git a/Think/Oauth/Driver/Baidu.php b/Think/Oauth/Driver/Baidu.php index b35189ac..84a82714 100644 --- a/Think/Oauth/Driver/Baidu.php +++ b/Think/Oauth/Driver/Baidu.php @@ -85,7 +85,7 @@ class Baidu extends Driver{ $userInfo['avatar'] = "http://tb.himg.baidu.com/sys/portrait/item/{$data['portrait']}"; return $userInfo; } else { - throw_exception("获取百度用户信息失败:{$data['error_msg']}"); + throw new Exception("获取百度用户信息失败:{$data['error_msg']}"); } }