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

深圳网站开发网站建设公司需要什么

深圳网站开发,网站建设公司需要什么,外贸自建站平台哪个好,没技术怎么做网站下载地址#xff1a; https://githubfast.com/anerg2046/sns_auth 安装方式建议使用composer进行安装 如果linux执行composer不方便的话#xff0c;可以在本地新建个文件夹#xff0c;然后执行上面的composer命令#xff0c;把代码sdk和composer文件一起上传到项目适当位…下载地址 https://githubfast.com/anerg2046/sns_auth 安装方式建议使用composer进行安装 如果linux执行composer不方便的话可以在本地新建个文件夹然后执行上面的composer命令把代码sdk和composer文件一起上传到项目适当位置然后 示例代码 ?php//以thinkCMF框架为例namespace app\home\controller;use cmf\controller\HomeBaseController;use think\facade\Db;use anerg\OAuth2\OAuth;class UserController extends HomebaseController{private function getThirdConfig($name){$sitehttp://xxxx.com; //更改为自己站点域名//下面的参数需要根据自己的实际需求替换$line_config[app_idlogin_line_appid,app_secretlogin_line_secret,scopeprofile];$facebook_config[app_idlogin_facebook_appid,app_secretlogin_facebook_secret,scopepublic_profile];$google_config[app_idlogin_google_appid..apps.googleusercontent.com,app_secretlogin_google_secret,scopehttps://www.googleapis.com/auth/userinfo.profile];$twitter_config[app_idlogin_twitter_appid,app_secretlogin_twitter_secret];$config[];switch ($name) {case line:$config$line_config;break;case facebook:$config$facebook_config;break;case google:$config$google_config;break;case twitter:$config$twitter_config;break;}$config[callback]$site./home/user/.$name._callback;return $config;}/*** Line登录*/public function line(){require_once /sns_auth/vendor/autoload.php;$nameline;$config$this-getThirdConfig($name);return redirect(OAuth::$name($config)-getRedirectUrl());}/**Line登陆回调**/public function line_callback(){$code $_GET[code] ?? ;if($code!){$this-third_callback(line);}else{$this-error(三方回调信息获取失败);}}/*** facebook登录*/public function facebook(){require_once /sns_auth/vendor/autoload.php;$namefacebook;$config$this-getThirdConfig($name);return redirect(OAuth::$name($config)-getRedirectUrl());}/*** Facebook登陆回调*/public function facebook_callback(){$code $_GET[code] ?? ;if($code!){$this-third_callback(facebook);}else{$this-error(三方回调信息获取失败);}}/*** Google登录*/public function google(){require_once /sns_auth/vendor/autoload.php;$namegoogle;$config$this-getThirdConfig($name);return redirect(OAuth::$name($config)-getRedirectUrl());}/*** Google登陆回调*/public function google_callback(){$code $_GET[code] ?? ;if($code!){$this-third_callback(google);}else{$this-error(三方回调信息获取失败);}}/*** twitter登录*/public function twitter(){require_once /sns_auth/vendor/autoload.php;$nametwitter;$config$this-getThirdConfig($name);return redirect(OAuth::$name($config)-getRedirectUrl());}/*** twitter登陆回调*/public function twitter_callback(){$code $_GET[code] ?? ;if($code!){$this-third_callback(twitter);}else{$this-error(三方回调信息获取失败);}}protected function third_callback($name){require_once /sns_auth/vendor/autoload.php;$config$this-getThirdConfig($name);$openinfo OAuth::$name($config)-userinfo();if(!$openinfo){$this-error(三方信息验证失败);return;}/*$openinfo[openid唯一标识,channelline,nickline昵称,gender性别,avatarline头像];*/$openid$openinfo[openid];$channel$openinfo[channel];$nickname$openinfo[nick];$avatar$openinfo[avatar];$userinfo$this-loginByThird($channel,$openid,$nickname,$avatar);if($userinfo1001){$this-assign(jumpUrl,/);$this-error(该账号已被禁用);return;}if($userinfo1002){$this-assign(jumpUrl,/);$this-error(该账号已被注销);return;}if($userinfo1003){$this-assign(jumpUrl,/);$this-error(该账号已被禁用);return;}$configpubgetConfigPub();session(uid,$userinfo[id]);session(token,$userinfo[token]);session(user,$userinfo);$hrefhttp://xxxx.com; //替换为自己站点的域名echo meta http-equivrefresh content0; url$href;}protected function loginByThird($type,$openid,$nickname,$avatar){//实际业务代码根据自己项目做修改$infoDB::name(user)-where(openid{$openid} and login_type{$type} and user_type2)-find();if(!$info){/* 注册 */$user_passabcdefg123456;$user_passcmf_password($user_pass); //密码加密方法请自己实现$user_login$type._.time().rand(100,999);if(!$nickname){$nickname$type.用户-.substr($openid,-4);}else{$nicknameurldecode($nickname);}if(!$avatar){$avatar/default.jpg;$avatar_thumb/default_thumb.jpg;}else{$avatarurldecode($avatar);$avatar_thumb$avatar;}$dataarray(user_login $user_login,user_nickname $nickname,user_pass $user_pass,signature 这家伙很懒什么都没留下,avatar $avatar,avatar_thumb $avatar_thumb,last_login_ip get_client_ip(0,true),create_time time(),user_status 1,openid $openid,login_type $type,user_type 2,//会员source pc);$uidDB::name(user)-insertGetId($data);$info[id]$uid;$info[user_nickname]$data[user_nickname];$info[avatar]$data[avatar];$info[avatar_thumb]$data[avatar_thumb];$info[sex]2;$info[signature]$data[signature];$info[coin]0;$info[login_type]$data[login_type];$info[province];$info[city];$info[birthday];$info[consumption]0;$info[votestotal]0;$info[user_status]1;$info[last_login_time];$info[end_bantime]0;}else{if(!$avatar){$avatar/default.jpg;$avatar_thumb/default_thumb.jpg;}else{$avatarurldecode($avatar);$avatar_thumb$avatar;}$info[avatar]$avatar;$info[avatar_thumb]$avatar_thumb;$dataarray(avatar $avatar,avatar_thumb $avatar_thumb,);}if($info[user_status]0){return 1001; }if($info[user_status]3){return 1002; }if($info[user_status]1 $info[end_bantime]time()){return 1003; }$info[isreg]0;$info[isagent]0;if($info[last_login_time] ){$info[isreg]1;$info[isagent]1;}$info[avatar]get_upload_path($info[avatar]);$info[avatar_thumb]get_upload_path($info[avatar_thumb]);return $info;}} 代码中各个配置参数如何获取 facebook Line: Google:
http://www.hkea.cn/news/14574808/

相关文章:

  • 社区网站建设论文wordpress哪个seo工具好
  • html5 单页网站商城网站建设建站系统
  • 做网站推广有前景吗网站开发一年多少钱
  • 包工头接活网站app凡客诚品市场份额
  • 电子商务网站建设一般流程图培训网网站源码
  • 花艺企业网站建设规划东莞住建局投诉电话是多少
  • 德惠市建设局网站app官方安装免费下载
  • 莱芜区网站北龙中网 可信网站验证 费用
  • 公司网站 英文网站建设的er图
  • 企业网站首页开发建设银行官网首页网站南山片区
  • 佛山网站建设专业定制网站的运营与维护
  • 肇庆网站关键词优化贸泽电子元器件商城
  • 河南建设工程协会网站局域网网站建设软件
  • 诚信网站体系建设工作总结如何用html在公司的网站上添加栏目路径
  • 网站链接怎么做谷歌搜索引擎google
  • 免费学平面设计的网站网站用绝对路径好还是相对路径seo
  • 营销型网站建站系统个人备案 什么网站
  • 找网站建设需要问什么中装建设市值
  • 网站前端是什么意思360网站免费推广怎么做
  • p2p网站策划金站网.营销型网站
  • 网站制作的总结与体会手机淘宝网页版登陆入口
  • 公司设计网站点开文字进入网站是怎么做的
  • html5手机网站特效个人网站代码html
  • 后台网站设计新闻稿营销
  • 做珠宝的网站资阳地网站seo
  • 摄影招聘网站单县网站建设
  • 网站建设介绍怎么写铁路建设工程网站
  • 荣成市信用建设官方网站酒店网站的规划与建设方案
  • 北京给网站做系统的公司名称自己做网络推广怎么做
  • app扁平化设计网站做网站运营用什么软件