mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
Oauth类增加setToken方法
This commit is contained in:
@@ -53,12 +53,17 @@ class Oauth {
|
|||||||
self::$handler->getAccessToken();
|
self::$handler->getAccessToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置保存过的token信息
|
||||||
|
static public function setToken($token){
|
||||||
|
self::$handler->setToken($token);
|
||||||
|
}
|
||||||
|
|
||||||
// 获取oauth用户信息
|
// 获取oauth用户信息
|
||||||
static public function getOauthInfo(){
|
static public function getOauthInfo(){
|
||||||
return self::$handler->getOauthInfo();
|
return self::$handler->getOauthInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取oauth用户信息
|
// 获取openid信息
|
||||||
static public function getOpenId(){
|
static public function getOpenId(){
|
||||||
return self::$handler->getOpenId();
|
return self::$handler->getOpenId();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class Baidu extends Driver{
|
|||||||
$userInfo['avatar'] = "http://tb.himg.baidu.com/sys/portrait/item/{$data['portrait']}";
|
$userInfo['avatar'] = "http://tb.himg.baidu.com/sys/portrait/item/{$data['portrait']}";
|
||||||
return $userInfo;
|
return $userInfo;
|
||||||
} else {
|
} else {
|
||||||
throw_exception("获取百度用户信息失败:{$data['error_msg']}");
|
throw new Exception("获取百度用户信息失败:{$data['error_msg']}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user