QQ的账号登录及api操作,使用oauth 2.0官方提供的sdk都太过庞大,这是我自己简化的,提供简单的账号登录、获取个人信息、发布分享等功能,如果需要其他功能可以根据官方的api文档自行添加[文件] qq.php
001 appid=$appid;
011 $this->appkey=$appkey;
012 $this->access_token=$access_token;
013 }
014
015 function login_url($callback_url, $scope=''){
016 $params=array(
017 'client_id'=>$this->appid,
018 'redirect_uri'=>$callback_url,
019 'response_type'=>'code',
020 'scope'=>$scope
021 );
022 return 'https://graph.qq.com/oauth2.0/authorize?'.http_build_query($params);
023 }
024
025 function access_token($callback_url, $code){
026 $params=array(
027 'grant_type'=>'authorization_code',
028 'client_i