当前位置: 首页 > news >正文

同ip网站做友链2023中国500强排名

同ip网站做友链,2023中国500强排名,潍坊住房公积金贷款额度,河北注册公司流程和费用登录谷歌邮箱开发者 https://console.developers.google.com/ 先创建项目 我们用的web应用 设置回调 核心主要#xff1a; 1.创建应用 2.创建客户端ID 3.设置域名和重定向URL 4.对外公开#xff0c;这样所有的gmail邮箱 都能参与测试PHP代码实现 引入第三方包 h…登录谷歌邮箱开发者 https://console.developers.google.com/ 先创建项目 我们用的web应用 设置回调 核心主要 1.创建应用 2.创建客户端ID 3.设置域名和重定向URL 4.对外公开这样所有的gmail邮箱 都能参与测试PHP代码实现 引入第三方包 https://github.com/googleapis/google-api-php-client/releases获取第三方跳转链接接口 public function googleUrl(){global $db,$request,$comId;//引入第三方包require_once inc/google_client/vendor/autoload.php; $googleConfig array(client_id客户端ID,project_idhudong,//项目名称auth_urihttps://accounts.google.com/o/oauth2/auth,token_urihttps://oauth2.googleapis.com/token,auth_provider_x509_cert_urlhttps://www.googleapis.com/oauth2/v1/certs,client_secret客户端秘钥,redirect_uris[https://vip.com/Google],//设置的回调结合 可以设置多个javascript_origins[https://vip.com]//设置的获取JavaScript的来源配置 );$clientID $googleConfig[client_id];$clientSecret $googleConfig[client_secret];$redirectUri $googleConfig[callBack] https://vip.com/Google; //当前项目回调地址// create Client Request to access Google API$client new \Google_Client();$client-setClientId($clientID);$client-setClientSecret($clientSecret);$client-setRedirectUri($redirectUri);$client-addScope(email);$client-addScope(profile);// authenticate code from Google OAuth Flow$loginUrl $client-createAuthUrl();$return[code] 1;$return[message] 获取成功;$return[data] array();$return[data][url] $loginUrl;return json_encode($return,JSON_UNESCAPED_UNICODE); }跳转之后 前端获取code 传给后台读取邮箱相关信息 public function googleLogin(){global $db,$request,$comId;require_once inc/google_client/vendor/autoload.php; // echo ABSPATH.inc/google_client/vendor/autoload.php; die;// require ../lib/internal/google-api-php-client--PHP7.0/vendor/autoload.php; // $googleConfig $this-snsaccount-googleAccount();$googleConfig array(client_id客户端ID,project_idhudong,//项目名称auth_urihttps://accounts.google.com/o/oauth2/auth,token_urihttps://oauth2.googleapis.com/token,auth_provider_x509_cert_urlhttps://www.googleapis.com/oauth2/v1/certs,client_secret客户端秘钥,redirect_uris[https://vip.com/Google],//设置的回调结合 可以设置多个javascript_origins[https://vip.com]//设置的获取JavaScript的来源配置 );$clientID $googleConfig[client_id];$clientSecret $googleConfig[client_secret];$redirectUri $googleConfig[callBack] https://tocmodels.com/Google; //Google console redirect URI $client new \Google_Client();$client-setClientId($clientID);$client-setClientSecret($clientSecret);$client-setRedirectUri($redirectUri);$client-addScope(email);$client-addScope(profile);$code $request[code];if(empty($code)) return {code:0,message:code为必传参数};$token $client-fetchAccessTokenWithAuthCode($request[code]);// var_dump($token);if(isset($token[error])) return {code:0,message:.$token[error].};$client-setAccessToken($token[access_token]);// get profile info$google_oauth new \Google_Service_Oauth2($client);$google_account_info $google_oauth-userinfo-get();$email $google_account_info-email;//谷歌邮箱$gid $google_account_info-id;//谷歌id$gname $google_account_info-name;//谷歌实名$image $google_account_info-picture;//谷歌头像}private function httpGet($url) {$curl curl_init();curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);curl_setopt($curl, CURLOPT_TIMEOUT, 500);curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);curl_setopt($curl, CURLOPT_URL, $url);$res curl_exec($curl);curl_close($curl);return $res;}
http://www.zqtcl.cn/news/335427/

相关文章:

  • 基于jsp的网站开发开题报告青海公路工程建设市场信用信息服务网站
  • 做网站页面的软件wordpress如何开启page页面评论
  • 做网站最简单的长春财经学院
  • 导购网站 icp备案要求网站设置ico
  • ftp做网站营销策划方案步骤
  • 网站建设若干意见wordpress查看数据库密码
  • 什么网站可以做宣传西安网站建设聚星互联
  • 产品展示网站源码2015年做哪些网站致富
  • 潍坊网站制作推广怎样做彩票网站
  • 做视频网站被判刑自己怎么做企业网站建设
  • 安庆网站建设兼职哪个公司的卡网络最好
  • tp框架做响应式网站青岛网站建设首选
  • 外国自适应企业网站做网站模板用什么框架
  • win7做网站服务器隐私浏览器
  • 优秀的设计网站广州排名推广
  • 做电商设计有什么好的网站推荐软件产品开发流程图
  • 建设网站请示宣传企业网站建设的
  • 汉中定制网站建设公司网站建设建站知识
  • 做壁纸网站建站优化办事效率高
  • linux 做网站数据库怎么开发ios软件
  • 沛县网站设计html制作网页的代码
  • 南昌网站建设公司如何万维网络(临沂网站建设)
  • 张家界做网站洛阳网站建设哪家专业
  • 快餐网站模板电子版邀请函制作软件免费
  • 有什么做视频的素材网站网站名称注册保护
  • 北京 顺义 网站制作h5网站网站建设
  • 网站在百度上搜不到了wordpress导航菜单加图片
  • wordpress网站访问慢网站建设35类
  • 绍兴做网站价格字体
  • asp.net网站开发实训可以不花钱做网站吗