PHP Class org\oauth\driver\Google

Inheritance: extends org\oauth\Driver
Show file Open project: top-think/thinkphp-extend

Protected Properties

Property Type Description
$apiBase string API根路径
$authorize srting 获取request_code的额外参数 URL查询字符串格式
$getAccessTokenURL string 获取access_token的api接口
$getRequestCodeURL string 获取requestCode的api接口

Public Methods

Method Description
call ( string $api, string $param = '', string $method = 'GET' ) : json 组装接口调用参数 并调用接口
getOauthInfo ( ) : array 获取当前登录的用户信息
getOpenId ( ) : string 获取当前授权应用的openid

Protected Methods

Method Description
parseToken ( string $result ) 解析access_token方法请求后的返回值

Method Details

call() public method

组装接口调用参数 并调用接口
public call ( string $api, string $param = '', string $method = 'GET' ) : json
$api string 微博API
$param string 调用API的额外参数
$method string HTTP请求方法 默认为GET
return json

getOauthInfo() public method

获取当前登录的用户信息
public getOauthInfo ( ) : array
return array

getOpenId() public method

获取当前授权应用的openid
public getOpenId ( ) : string
return string

parseToken() protected method

解析access_token方法请求后的返回值
protected parseToken ( string $result )
$result string 获取access_token的方法的返回值

Property Details

$apiBase protected property

API根路径
protected string $apiBase
return string

$authorize protected property

获取request_code的额外参数 URL查询字符串格式
protected srting $authorize
return srting

$getAccessTokenURL protected property

获取access_token的api接口
protected string $getAccessTokenURL
return string

$getRequestCodeURL protected property

获取requestCode的api接口
protected string $getRequestCodeURL
return string