什么是thinkphp3.2 语言包3核心包

网站已改版,请使用新地址访问:
x-crm 基于thinkphp3.23+B-JUI开发,权限运用了Auth类认证 可以细分到每个功能,增删改 WEB(ASP,PHP,...) 274万源代码下载-
&文件名称: x-crm& & [
& & & & &&]
&&所属分类:
&&开发工具: Java
&&文件大小: 8608 KB
&&上传时间:
&&下载次数: 0
&&提 供 者:
&详细说明:基于thinkphp3.23+B-JUI开发,权限运用了Auth类认证,权限可以细分到每个功能,增删改查功能一应俱全,整合了PHPExcel导出功能,数据分析图形使用了Jpgraph图表。
X-Mis是一款开放式的管理平台,能容纳管理各种数据、实现信息互通共享;能快速搭建适合自己的 OA、CRM、HR 等管理软件。小到个人的记账记事,大到企事业单位的客户信息、项目信息、销售订单、售后报修、出库入库、固定资产、人事薪资、办公信息、收费付费...等各种信息,全都能管理!-Based on the thinkphp3.23+B-JUI development, the use of the Auth class certification authority, permission can be subdivided into each function, crud functions integration of the PHPExcel export function Goods are available in all varieties., data analysis, graphics using Jpgraph chart.
X-Mis is an open management platform that can accommodate a variety of data management, exchange of information sharing
can quickly build their own OA, CRM, HR and other management software. Small personal accounting record, to enterprise customer information, project information, sales orders, customer service repair,
storage, fixed assets, personnel salary, office information, payment and other information,... All management!
文件列表(点击判断是否您需要的文件,如果是垃圾请在下面评价投诉):
&&X-CRM3\App\Common\Api\ConfigApi.class.php&&......\...\......\Common\function.php&&......\...\......\......\index.html&&......\...\......\..nf\config.php&&......\...\......\....\db.php&&......\...\......\....\email.php&&......\...\......\....\index.html&&......\...\......\....\other.php&&......\...\......\....\sms.php&&......\...\......\....\ueditor.json&&......\...\......\....\web.php&&......\...\......\...troller\BaseController.class.php&&......\...\......\index.html&&......\...\Home\Common\index.html&&......\...\....\..nf\config.php&&......\...\....\....\index.html&&......\...\....\...troller\BasicController.class.php&&......\...\....\..........\ChanpinController.class.php&&......\...\....\..........\ChukuController.class.php&&......\...\....\..........\ChukusController.class.php&&......\...\....\..........\CommonController.class.php&&......\...\....\..........\ConfigController.class.php&&......\...\....\..........\CustconController.class.php&&......\...\....\..........\CustController.class.php&&......\...\....\..........\CustgdController.class.php&&......\...\....\..........\DatabaseController.class.php&&......\...\....\..........\DatalistController.class.php&&......\...\....\..........\DepController.class.php&&......\...\....\..........\DwtxlController.class.php&&......\...\....\..........\EmailsController.class.php&&......\...\....\..........\EmptyController.class.php&&......\...\....\..........\FahuoController.class.php&&......\...\....\..........\FukuanController.class.php&&......\...\....\..........\FxcaiwuController.class.php&&......\...\....\..........\FxchanpinController.class.php&&......\...\....\..........\FxcustController.class.php&&......\...\....\..........\FxhetongController.class.php&&......\...\....\..........\GgtxlController.class.php&&......\...\....\..........\HetongController.class.php&&......\...\....\..........\HetongsController.class.php&&......\...\....\..........\HuibaoController.class.php&&......\...\....\..........\HuibaosController.class.php&&......\...\....\..........\HuifangController.class.php&&......\...\....\..........\index.html&&......\...\....\..........\IndexController.class.php&&......\...\....\..........\jiaobanController.class.php&&......\...\....\..........\KaipiaoController.class.php&&......\...\....\..........\LogController.class.php&&......\...\....\..........\MainController.class.php&&......\...\....\..........\MenuController.class.php&&......\...\....\..........\MsgController.class.php&&......\...\....\..........\MsgsController.class.php&&......\...\....\..........\OrgController.class.php&&......\...\....\..........\PublicController.class.php&&......\...\....\..........\QuxiangController.class.php&&......\...\....\..........\QuxiangsController.class.php&&......\...\....\..........\RenwuController.class.php&&......\...\....\..........\RukuController.class.php&&......\...\....\..........\RukusController.class.php&&......\...\....\..........\RuleController.class.php&&......\...\....\..........\ShouController.class.php&&......\...\....\..........\SmsController.class.php&&......\...\....\..........\SmsczController.class.php&&......\...\....\..........\SmsfsController.class.php&&......\...\....\..........\SmssController.class.php&&......\...\....\..........\TjchanpinController.class.php&&......\...\....\..........\TjhetongController.class.php&&......\...\....\..........\TongzhiController.class.php&&......\...\....\..........\TousuController.class.php&&......\...\....\..........\UserController.class.php&&......\...\....\..........\WdtxlController.class.php&&......\...\....\..........\WendangController.class.php&&......\...\....\..........\WendangsController.class.php&&......\...\....\..........\ZhishiController.class.php&&......\...\....\index.html&&......\...\....\Model\ChanpinModel.class.php&&......\...\....\.....\ChukuModel.class.php&&......\...\....\.....\ChukusModel.class.php&&......\...\....\.....\ConfigModel.class.php&&......\...\....\.....\CustconModel.class.php&&......\...\....\.....\CustgdModel.class.php&&......\...\....\.....\CustModel.class.php&&......\...\....\.....\DatalistModel.class.php&&......\...\....\.....\EmailsModel.class.php&&......\...\....\.....\FahuoModel.class.php&&......\...\....\.....\FukuanModel.class.php&&......\...\....\.....\HetongModel.class.php&&......\...\....\.....\HetongsModel.class.php&&......\...\....\.....\HuibaoModel.class.php&&......\...\....\.....\HuibaosModel.class.php&&......\...\....\.....\HuifangModel.class.php&&......\...\....\.....\index.html&&......\...\....\.....\KaipiaoModel.class.php&&......\...\....\.....\MsgModel.class.php&&......\...\....\.....\QuxiangModel.class.php&&......\...\....\.....\RenwuModel.class.php&&......\...\....\.....\RukuModel.class.php&&......\...\....\.....\RukusModel.class.php&&......\...\....\.....\ShenheModel.class.php&&......\...\....\.....\ShouModel.class.php
&输入关键字,在本站274万海量源码库中尽情搜索:thinkphp 3.23 第三方登录sdk集成包 - ThinkPHP框架
本集成包在官方包上扩展了支付宝登录和微信,支持最新的3.23版本
config&&&&/*&URL配置&*/
&&&&'URL_CASE_INSENSITIVE'&=&&true,&//默认false&表示URL区分大小写&true则表示不区分大小写
&&&&'URL_MODEL'&&&&&&&&&&&&=&&3,&//URL模式
&&&&'VAR_URL_PARAMS'&&&&&&&=&&'',&//&PATHINFO&URL参数变量
&&&&'URL_PATHINFO_DEPR'&&&&=&&'/',&//PATHINFO&URL分割符
/*&加载扩展配置文件&*/
&&&&'LOAD_EXT_CONFIG'&=&&'sdk_config',sdk_config&?php
//&+----------------------------------------------------------------------
//&|&LTHINK&[&WE&CAN&DO&IT&JUST&THINK&]
//&+----------------------------------------------------------------------
//&|&Copyright&(c)&&&All&rights&reserved.
//&+----------------------------------------------------------------------
//&|&Author:&涛哥&&liangtao.&
//&+----------------------------------------------------------------------
//&|&sdk_config.php&
//&+----------------------------------------------------------------------
//定义回调URL通用的URL
define('URL_CALLBACK',&'http://'&.&$_SERVER['SERVER_NAME']&.&'?s=/User/Index/callback');
return&array(
&&&&//支付宝登录
&&&&'THINK_SDK_ALIPAY'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'alipay',
&&&&//微信登录
&&&&'THINK_SDK_WEIXIN'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'weixin',
&&&&//腾讯QQ登录配置
&&&&'THINK_SDK_QQ'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'qq',
&&&&//腾讯微博配置
&&&&'THINK_SDK_TENCENT'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'tencent',
&&&&//新浪微博配置
&&&&'THINK_SDK_SINA'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'sina',
&&&&//网易微博配置
&&&&'THINK_SDK_T163'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'t163',
&&&&//人人网配置
&&&&'THINK_SDK_RENREN'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'renren',
&&&&//360配置
&&&&'THINK_SDK_X360'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'x360',
&&&&//豆瓣配置
&&&&'THINK_SDK_DOUBAN'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'douban',
&&&&//Github配置
&&&&'THINK_SDK_GITHUB'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'github',
&&&&//Google配置
&&&&'THINK_SDK_GOOGLE'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'google',
&&&&//MSN配置
&&&&'THINK_SDK_MSN'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'msn',
&&&&//点点配置
&&&&'THINK_SDK_DIANDIAN'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'diandian',
&&&&//淘宝网配置
&&&&'THINK_SDK_TAOBAO'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'taobao',
&&&&//百度配置
&&&&'THINK_SDK_BAIDU'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'baidu',
&&&&//开心网配置
&&&&'THINK_SDK_KAIXIN'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'kaixin',
&&&&//搜狐微博配置
&&&&'THINK_SDK_SOHU'&=&&array(
&&&&&&&&'APP_KEY'&=&&'',&//应用注册成功后分配的&APP&ID
&&&&&&&&'APP_SECRET'&=&&'',&//应用注册成功后分配的KEY
&&&&&&&&'CALLBACK'&=&&URL_CALLBACK&.&'sohu',
);IndexController&?php
//&+----------------------------------------------------------------------
//&|&LTHINK&[&WE&CAN&DO&IT&JUST&THINK&]
//&+----------------------------------------------------------------------
//&|&Copyright&(c)&&&All&rights&reserved.
//&+----------------------------------------------------------------------
//&|&Author:&涛哥&&liangtao.&
//&+----------------------------------------------------------------------
//&IndexAction.class.php&
namespace&User\C
use&Think\C
use&LT\ThinkSDK\ThinkO
Header('Content-Type:&text/&charset=utf-8');
class&IndexController&extends&Controller
&&&&//SNS登录首页
&&&&public&function&index()
&&&&&&&&lt(URL_CALLBACK);
&&&&&&&&$this-&display();
&&&&//登录地址
&&&&public&function&login($type&=&null)
&&&&&&&&empty($type)&&&&$this-&error('参数错误');
&&&&&&&&//加载ThinkOauth类并实例化一个对象
&&&&&&&&$sns&=&ThinkOauth::getInstance($type);
&&&&&&&&//跳转到授权页面
&&&&&&&&redirect($sns-&getRequestCodeURL());
&&&&//授权回调地址
&&&&public&function&callback($type&=&null,&$code&=&null)
&&&&&&&&(empty($type)&||&empty($code))&&&&$this-&error('参数错误');
&&&&&&&&//加载ThinkOauth类并实例化一个对象
&&&&&&&&$sns&=&ThinkOauth::getInstance($type);
&&&&&&&&//腾讯微博需传递的额外参数
&&&&&&&&$extend&=&
&&&&&&&&if&($type&==&'tencent')&{
&&&&&&&&&&&&$extend&=&array('openid'&=&&$this-&_get('openid'),&'openkey'&=&&$this-&_get('openkey'));
&&&&&&&&//请妥善保管这里获取到的Token信息,方便以后API调用
&&&&&&&&//调用方法,实例化SDK对象的时候直接作为构造函数的第二个参数传入
&&&&&&&&//如:&$qq&=&ThinkOauth::getInstance('qq',&$token);
&&&&&&&&$token&=&$sns-&getAccessToken($code,&$extend);
&&&&&&&&//获取当前登录用户信息
&&&&&&&&if&(is_array($token))&{
&&&&&&&&&&&&$user_info&=&A('Type',&'Event')-&$type($token);
&&&&&&&&&&&&echo(&&h1&恭喜!使用&{$type}&用户登录成功&/h1&&br&&);
&&&&&&&&&&&&echo(&授权信息为:&br&&);
&&&&&&&&&&&&dump($token);
&&&&&&&&&&&&echo(&当前登录用户信息为:&br&&);
&&&&&&&&&&&&dump($user_info);
}TypeEvent.class&?php
//&+----------------------------------------------------------------------
//&|&LTHINK&[&WE&CAN&DO&IT&JUST&THINK&]
//&+----------------------------------------------------------------------
//&|&Copyright&(c)&&&All&rights&reserved.
//&+----------------------------------------------------------------------
//&|&Author:&涛哥&&liangtao.&
//&+----------------------------------------------------------------------
//&TypeEvent.class.php&
namespace&User\E
use&LT\ThinkSDK\ThinkO
Header('Content-Type:&text/&charset=utf-8');
class&TypeEvent
&&&&//登录成功,获取腾讯QQ用户信息
&&&&public&function&qq($token)
&&&&&&&&$qq&=&ThinkOauth::getInstance('qq',&$token);
&&&&&&&&$data&=&$qq-&call('user/get_user_info');
&&&&&&&&if&($data['ret']&==&0)&{
&&&&&&&&&&&&$userInfo['type']&=&'QQ';
&&&&&&&&&&&&$userInfo['name']&=&$data['nickname'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['nickname'];
&&&&&&&&&&&&$userInfo['head']&=&$data['figureurl_2'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取腾讯QQ用户信息失败:{$data['msg']}&);
&&&&//登录成功,获取腾讯微博用户信息
&&&&public&function&tencent($token)
&&&&&&&&$tencent&=&ThinkOauth::getInstance('tencent',&$token);
&&&&&&&&$data&=&$tencent-&call('user/info');
&&&&&&&&if&($data['ret']&==&0)&{
&&&&&&&&&&&&$userInfo['type']&=&'TENCENT';
&&&&&&&&&&&&$userInfo['name']&=&$data['data']['name'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['data']['nick'];
&&&&&&&&&&&&$userInfo['head']&=&$data['data']['head'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取腾讯微博用户信息失败:{$data['msg']}&);
&&&&//登录成功,获取新浪微博用户信息
&&&&public&function&sina($token)
&&&&&&&&$sina&=&ThinkOauth::getInstance('sina',&$token);
&&&&&&&&$data&=&$sina-&call('users/show',&&uid={$sina-&openid()}&);
&&&&&&&&if&($data['error_code']&==&0)&{
&&&&&&&&&&&&$userInfo['type']&=&'SINA';
&&&&&&&&&&&&$userInfo['name']&=&$data['name'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['screen_name'];
&&&&&&&&&&&&$userInfo['head']&=&$data['avatar_large'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取新浪微博用户信息失败:{$data['error']}&);
&&&&//登录成功,获取网易微博用户信息
&&&&public&function&t163($token)
&&&&&&&&$t163&=&ThinkOauth::getInstance('t163',&$token);
&&&&&&&&$data&=&$t163-&call('users/show');
&&&&&&&&if&($data['error_code']&==&0)&{
&&&&&&&&&&&&$userInfo['type']&=&'T163';
&&&&&&&&&&&&$userInfo['name']&=&$data['name'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['screen_name'];
&&&&&&&&&&&&$userInfo['head']&=&str_replace('w=48&h=48',&'w=180&h=180',&$data['profile_image_url']);
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取网易微博用户信息失败:{$data['error']}&);
&&&&//登录成功,获取人人网用户信息
&&&&public&function&renren($token)
&&&&&&&&$renren&=&ThinkOauth::getInstance('renren',&$token);
&&&&&&&&$data&=&$renren-&call('users.getInfo');
&&&&&&&&if&(!isset($data['error_code']))&{
&&&&&&&&&&&&$userInfo['type']&=&'RENREN';
&&&&&&&&&&&&$userInfo['name']&=&$data[0]['name'];
&&&&&&&&&&&&$userInfo['nick']&=&$data[0]['name'];
&&&&&&&&&&&&$userInfo['head']&=&$data[0]['headurl'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取人人网用户信息失败:{$data['error_msg']}&);
&&&&//登录成功,获取360用户信息
&&&&public&function&x360($token)
&&&&&&&&$x360&=&ThinkOauth::getInstance('x360',&$token);
&&&&&&&&$data&=&$x360-&call('user/me');
&&&&&&&&if&($data['error_code']&==&0)&{
&&&&&&&&&&&&$userInfo['type']&=&'X360';
&&&&&&&&&&&&$userInfo['name']&=&$data['name'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['name'];
&&&&&&&&&&&&$userInfo['head']&=&$data['avatar'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取360用户信息失败:{$data['error']}&);
&&&&//登录成功,获取豆瓣用户信息
&&&&public&function&douban($token)
&&&&&&&&$douban&=&ThinkOauth::getInstance('douban',&$token);
&&&&&&&&$data&=&$douban-&call('user/~me');
&&&&&&&&if&(empty($data['code']))&{
&&&&&&&&&&&&$userInfo['type']&=&'DOUBAN';
&&&&&&&&&&&&$userInfo['name']&=&$data['name'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['name'];
&&&&&&&&&&&&$userInfo['head']&=&$data['avatar'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取豆瓣用户信息失败:{$data['msg']}&);
&&&&//登录成功,获取Github用户信息
&&&&public&function&github($token)
&&&&&&&&$github&=&ThinkOauth::getInstance('github',&$token);
&&&&&&&&$data&=&$github-&call('user');
&&&&&&&&if&(empty($data['code']))&{
&&&&&&&&&&&&$userInfo['type']&=&'GITHUB';
&&&&&&&&&&&&$userInfo['name']&=&$data['login'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['name'];
&&&&&&&&&&&&$userInfo['head']&=&$data['avatar_url'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取Github用户信息失败:{$data}&);
&&&&//登录成功,获取Google用户信息
&&&&public&function&google($token)
&&&&&&&&$google&=&ThinkOauth::getInstance('google',&$token);
&&&&&&&&$data&=&$google-&call('userinfo');
&&&&&&&&if&(!empty($data['id']))&{
&&&&&&&&&&&&$userInfo['type']&=&'GOOGLE';
&&&&&&&&&&&&$userInfo['name']&=&$data['name'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['name'];
&&&&&&&&&&&&$userInfo['head']&=&$data['picture'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取Google用户信息失败:{$data}&);
&&&&//登录成功,获取Google用户信息
&&&&public&function&msn($token)
&&&&&&&&$msn&=&ThinkOauth::getInstance('msn',&$token);
&&&&&&&&$data&=&$msn-&call('me');
&&&&&&&&if&(!empty($data['id']))&{
&&&&&&&&&&&&$userInfo['type']&=&'MSN';
&&&&&&&&&&&&$userInfo['name']&=&$data['name'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['name'];
&&&&&&&&&&&&$userInfo['head']&=&'微软暂未提供头像URL,请通过&me/picture&接口下载';
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取msn用户信息失败:{$data}&);
&&&&//登录成功,获取点点用户信息
&&&&public&function&diandian($token)
&&&&&&&&$diandian&=&ThinkOauth::getInstance('diandian',&$token);
&&&&&&&&$data&=&$diandian-&call('user/info');
&&&&&&&&if&(!empty($data['meta']['status'])&&&&$data['meta']['status']&==&200)&{
&&&&&&&&&&&&$userInfo['type']&=&'DIANDIAN';
&&&&&&&&&&&&$userInfo['name']&=&$data['response']['name'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['response']['name'];
&&&&&&&&&&&&$userInfo['head']&=&&/v1/blog/{$data['response']['blogs'][0]['blogUuid']}/avatar/144&;
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取点点用户信息失败:{$data}&);
&&&&//登录成功,获取淘宝网用户信息
&&&&public&function&taobao($token)
&&&&&&&&$taobao&=&ThinkOauth::getInstance('taobao',&$token);
&&&&&&&&$fields&=&'user_id,nick,sex,buyer_credit,avatar,has_shop,vip_info';
&&&&&&&&$data&=&$taobao-&call('taobao.user.buyer.get',&&fields={$fields}&);
&&&&&&&&if&(!empty($data['user_buyer_get_response']['user']))&{
&&&&&&&&&&&&$user&=&$data['user_buyer_get_response']['user'];
&&&&&&&&&&&&$userInfo['type']&=&'TAOBAO';
&&&&&&&&&&&&$userInfo['name']&=&$user['user_id'];
&&&&&&&&&&&&$userInfo['nick']&=&$user['nick'];
&&&&&&&&&&&&$userInfo['head']&=&$user['avatar'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取淘宝网用户信息失败:{$data['error_response']['msg']}&);
&&&&//登录成功,获取百度用户信息
&&&&public&function&baidu($token)
&&&&&&&&$baidu&=&ThinkOauth::getInstance('baidu',&$token);
&&&&&&&&$data&=&$baidu-&call('passport/users/getLoggedInUser');
&&&&&&&&if&(!empty($data['uid']))&{
&&&&&&&&&&&&$userInfo['type']&=&'BAIDU';
&&&&&&&&&&&&$userInfo['name']&=&$data['uid'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['uname'];
&&&&&&&&&&&&$userInfo['head']&=&&http://tb./sys/portrait/item/{$data['portrait']}&;
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取百度用户信息失败:{$data['error_msg']}&);
&&&&//登录成功,获取开心网用户信息
&&&&public&function&kaixin($token)
&&&&&&&&$kaixin&=&ThinkOauth::getInstance('kaixin',&$token);
&&&&&&&&$data&=&$kaixin-&call('users/me');
&&&&&&&&if&(!empty($data['uid']))&{
&&&&&&&&&&&&$userInfo['type']&=&'KAIXIN';
&&&&&&&&&&&&$userInfo['name']&=&$data['uid'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['name'];
&&&&&&&&&&&&$userInfo['head']&=&$data['logo50'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取开心网用户信息失败:{$data['error']}&);
&&&&//登录成功,获取搜狐用户信息
&&&&public&function&sohu($token)
&&&&&&&&$sohu&=&ThinkOauth::getInstance('sohu',&$token);
&&&&&&&&$data&=&$sohu-&call('i/prv/1/user/get-basic-info');
&&&&&&&&if&('success'&==&$data['message']&&&&!empty($data['data']))&{
&&&&&&&&&&&&$userInfo['type']&=&'SOHU';
&&&&&&&&&&&&$userInfo['name']&=&$data['data']['open_id'];
&&&&&&&&&&&&$userInfo['nick']&=&$data['data']['nick'];
&&&&&&&&&&&&$userInfo['head']&=&$data['data']['icon'];
&&&&&&&&&&&&return&$userI
&&&&&&&&}&else&{
&&&&&&&&&&&&throw_exception(&获取搜狐用户信息失败:{$data['message']}&);
}使用方式:
1、使用命名空间
use LT\ThinkSDK\ThinkO
2、设置三方登录的类别并赋予一个变量
$type = ThinkOauth::getInstance('qq');
3、设置配置文件
'THINK_SDK_(TYPE)' =& array(
'APP_KEY'
=& '', //应用注册成功后分配的 APP ID
'APP_SECRET' =& '', //应用注册成功后分配的KEY
'CALLBACK'
=& '', //注册应用填写的callback
上文中的(TYPE)为设置的类别,其值目前有以下几个:
//支付宝登录 THINK_SDK_ALIPAY
//微信登录 THINK_SDK_WEIXIN
//腾讯QQ登录配置 THINK_SDK_QQ
// 用户基本信息API接口 user/get_user_info
//腾讯微博配置 THINK_SDK_TENCENT
// 用户基本信息API接口 user/info
//新浪微博配 THINK_SDK_SINA
// 用户基本信息API接口 users/show。附加参数:'uid='.$obj-&openid()
//网易微博配置 THINK_SDK_T163
// 用户基本信息API接口 users/show
//人人网配置 THINK_SDK_RENREN
// 用户基本信息API接口 users.getInfo
//360配置 THINK_SDK_X360
// 用户基本信息API接口 user/me
//豆瓣配置 THINK_SDK_DOUBAN
// 用户基本信息API接口 user/~me
//Github配置 THINK_SDK_GITHUB
// 用户基本信息API接口 user
//Google配置 THINK_SDK_GOOGLE
// 用户基本信息API接口 userinfo
//MSN配置 THINK_SDK_MSN
// 用户基本信息API接口 msn。附加参数:token
//点点配置 THINK_SDK_DIANDIAN
// 用户基本信息API接口 user/info
//淘宝网配置 THINK_SDK_TAOBAO
// 用户基本信息API接口 taobao.user.buyer.get。附加参数:'fields=user_id,nick,sex,buyer_credit,avatar,has_shop,vip_info'
//百度配置 THINK_SDK_BAIDU
// 用户基本信息API接口 passport/users/getLoggedInUser
// 注意,百度的头像位置是http://tb./sys/portrait/item/{$data['portrait']}
//开心网配置 THINK_SDK_KAIXIN
// 用户基本信息API接口 users/me
//搜狐微博配置 THINK_SDK_SOHU
// 用户基本信息API接口 i/prv/1/user/get-basic-info
4、实例化一个登录页面
redirect($type-&getRequestCodeURL());
这里的$type是第二部获取的结果
5、回调页面
$code = $this-&get('code');
$type = 'QQ';
= ThinkOauth::getInstance($type);
//腾讯微博需传递的额外参数
if($type == 'tencent'){
$extend = array('openid' =& $this-&_get('openid'), 'openkey' =& $this-&_get('openkey'));
//请妥善保管这里获取到的Token信息,方便以后API调用
//调用方法,实例化SDK对象的时候直接作为构造函数的第二个参数传入
//如: $qq = ThinkOauth::getInstance('qq', $token);
$token = $sns-&getAccessToken($code , $extend);
//获取当前登录用户信息
if(is_array($token)){
$data = $sns-&call('user/get_user_info');
if($data['ret'] == 0){
$userInfo['type'] = 'QQ';
$userInfo['name'] = $data['nickname'];
$userInfo['nick'] = $data['nickname'];
$userInfo['head'] = $data['figureurl_2'];
// 此处的$userInfo就是需要的用户信息
E('获取腾讯QQ用户信息失败 : '.$data['msg']);
ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。}

我要回帖

更多关于 thinkphp打包app 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信