1.params.php 配置 //开放登录接口配置 'openAuth'=>array( 'wbAkey'=>'1269090619', 'wbSkey'=>'2eaf3d5abc07fc86a21267d169b3f9d3', 'qqAkey'=>'101202502', 'qqSkey'=>'f9cda49e67331e03ccd2453c63e57733', 'qqcallbackUrl'=>'', 'wbcallbackUrl'=>'', ), 2.components.php 配置 //第三方登录 'openauth' => array( 'class' => 'application.extensions.OpenAuth.OpenAuth', ), 3.main.php 配置 'import'=>array( ... 'ext.OpenAuth.OpenAuth', ... ), 4.将 OpenAuthController.php(控制器示例代码) 放置在正确位置,并配置正确的回调地址 5.绑定记录表 CREATE TABLE `wz_user_open_auth` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'ID', `user_id` int(10) unsigned NOT NULL COMMENT '本地用户ID', `app` char(15) NOT NULL COMMENT '第三方应用', `app_uid` varchar(50) NOT NULL COMMENT '第三方应用的标识符', `user_info` text COMMENT '第三方应用公布的信息', `bind_time` int(10) unsigned NOT NULL COMMENT '绑定时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 6.用户表 CREATE TABLE `wz_user` ( `user_id` int(10) unsigned NOT NULL auto_increment COMMENT 'ID', `user_name` varchar(50) NOT NULL COMMENT '用户名', `user_pwd` varchar(32) NOT NULL default '' COMMENT '密码', `group_id` tinyint(3) unsigned NOT NULL default '1' COMMENT '用户组ID', `encrypt` varchar(20) NOT NULL default '' COMMENT '加密因子', `email` varchar(40) NOT NULL default '' COMMENT '电子邮箱', `mobile` char(11) NOT NULL default '' COMMENT '手机号码', `nick_name` varchar(20) NOT NULL default '' COMMENT '昵称', `register_ip` int(10) NOT NULL default '0' COMMENT '注册IP', `last_login_ip` int(10) NOT NULL default '0' COMMENT '最后登录IP', `register_time` int(10) unsigned NOT NULL default '0' COMMENT '注册时间', `last_login_time` int(10) unsigned NOT NULL default '0' COMMENT '最后登录时间', `login_num` int(11) unsigned NOT NULL default '0' COMMENT '登录次数', `region_id` int(11) unsigned NOT NULL default '0' COMMENT '地区', `amount` int(11) unsigned NOT NULL default '0' COMMENT '账户金额', `point` int(11) unsigned NOT NULL default '0' COMMENT '积分', `model_id` smallint(5) unsigned NOT NULL default '0' COMMENT '模型', `have_message` tinyint(3) unsigned NOT NULL default '0' COMMENT '是否有短消息', `is_lock` tinyint(1) unsigned NOT NULL default '0' COMMENT '状态:1,锁定', `vip` tinyint(1) unsigned NOT NULL default '0' COMMENT '是否VIP', `overdue_date` int(11) unsigned NOT NULL default '0' COMMENT 'vip过期时间', `site_id` smallint(6) unsigned NOT NULL default '0' COMMENT '所属站点', `registered_from` smallint(5) unsigned NOT NULL default '0' COMMENT '注册来源', `disable_form_login` tinyint(1) unsigned NOT NULL default '0' COMMENT '禁止表单登录(如第三方登录的用户)', PRIMARY KEY (`user_id`) ) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='会员表'