本人是ucenter的新手,下载了官方的手册。也应用了里面的例子。
背景
1.安装的程序:discuz!x(同时默认安装里面的 ucenter_server)
discuz!x的路径:http://localhost/discuzx/index.php
ucenter的路径: http://localhost/discuzx/uc_server
手册里面的examples: http://localhost/uc_example/examples/ucexample_1.php(即第三方应用开发)
2.两个应用程序通信成功,如下图
1小时前 上传下载附件 (8 KB)
3.http://localhost/uc_example/examples/ucexample_1.php(即第三方应用开发) uc配置文件如下
- define(‘UC_CONNECT’, ‘mysql’); // 连接 UCenter 的方式: mysql/NULL, 默认为空时为 fscoketopen()// mysql 是直接连接的数据库, 为了效率, 建议采用 mysql//数据库相关 (mysql 连接时, 并且没有设置 UC_DBLINK 时, 需要配置以下变量)define(‘UC_DBHOST’, ‘localhost’); // UCenter 数据库主机define(‘UC_DBUSER’, ‘root’); // UCenter 数据库用户名define(‘UC_DBPW’, ‘123456’); // UCenter 数据库密码define(‘UC_DBNAME’, ‘ultrax’); // UCenter 数据库名称define(‘UC_DBCHARSET’, ‘gbk’); // UCenter 数据库字符集define(‘UC_DBTABLEPRE’, ‘ultrax.pre_ucenter_’); // UCenter 数据库表前缀//通信相关define(‘UC_CONNECT’, ‘mysql’);define(‘UC_DBHOST’, ‘localhost’);define(‘UC_DBUSER’, ‘root’);define(‘UC_DBPW’, ‘123456’);define(‘UC_DBNAME’, ‘ultrax’);define(‘UC_DBCHARSET’, ‘gbk’);define(‘UC_DBTABLEPRE’, ‘`ultrax`.pre_ucenter_’);define(‘UC_DBCONNECT’, ‘0’);define(‘UC_KEY’, ‘123456789’);define(‘UC_API’, ‘http://localhost/discuzx/uc_server’);define(‘UC_CHARSET’, ‘gbk’);define(‘UC_IP’, ”);define(‘UC_APPID’, ‘2’);define(‘UC_PPP’, ’20’);//同步登录 Cookie 设置$cookiedomain = ”; // cookie 作用域$cookiepath = ‘/’; // cookie 作用路径
复制代码
4.uc_server 里面已经开启同步登录
5.我在 http://localhost/uc_example/examples/ucexample_1.php 里面的注册成功~!然后跑去discuz!x手动激活, 这个时候如果在ucexample_1.php里面登录,discuz!x也可以同时登录
6.在ucexample_1.php登录之后没去discuz!x手动激活,则不能两边同时登录
问题
现在在http://localhost/uc_example/examples/ucexample_1.php(第三方应用) 注册成功并且登录成功。
但现在打开 http://localhost/discuzx/index.php 没有登录成功,也不提示激活.
期待结果
在 http://localhost/uc_example/examples/ucexample_1.php(第三方应用) 登录成功的时候,打开http://localhost/discuzx/index.php能提示激活.
ps :鄙人认为应该修改discuz!x文件,但我不知道如何修改~!
自己要先看得起自己,别人才会看得起你