Oauth类增加setToken方法

This commit is contained in:
thinkphp
2013-03-29 20:50:44 +08:00
parent c2638c98ef
commit b16067caf3
2 changed files with 7 additions and 2 deletions

View File

@@ -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();
}

View File

@@ -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']}");
}
}