|
|
|
@ -7,6 +7,7 @@ use Think\Controller;
|
|
|
|
|
use User\Api\MemberApi;
|
|
|
|
|
use Org\XiguSDK\Xigu;
|
|
|
|
|
use Org\UcenterSDK\Ucservice;
|
|
|
|
|
use Base\Service\UserService;
|
|
|
|
|
|
|
|
|
|
class UserController extends BaseController
|
|
|
|
|
{
|
|
|
|
@ -280,22 +281,10 @@ class UserController extends BaseController
|
|
|
|
|
/**是否开启ucenter**/
|
|
|
|
|
if(C('UC_OPEN')==1){
|
|
|
|
|
//Ucenter注册
|
|
|
|
|
|
|
|
|
|
//1.验证本平台是否存在账号
|
|
|
|
|
$is_user_info = M('user','tab_')->where(['account'=>$account])->find();
|
|
|
|
|
if(!empty($is_user_info)){
|
|
|
|
|
$this->set_message(1017, '用户名已存在');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//2.验证其他平台是否存在账号
|
|
|
|
|
$domain = C('UC_OTHER_WEB_URL');
|
|
|
|
|
if(!empty($domain)){
|
|
|
|
|
$url = "http://{$domain}/Api/user/checkUserName?account={$account}";
|
|
|
|
|
$check_res = json_decode(file_get_contents($url),true);
|
|
|
|
|
if($check_res['status']==0){
|
|
|
|
|
$userService = new UserService();
|
|
|
|
|
if ($userService->isAccountExist($account)) {
|
|
|
|
|
$this->set_message(1017, '用户名已存在');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//3.ucenter注册账号
|
|
|
|
|
$ucresult = uc_user_checkname($account);
|
|
|
|
@ -346,24 +335,11 @@ class UserController extends BaseController
|
|
|
|
|
$user['nickname'] = $nickname;
|
|
|
|
|
/**是否开启ucenter**/
|
|
|
|
|
if(C('UC_OPEN')==1){
|
|
|
|
|
//Ucenter注册
|
|
|
|
|
|
|
|
|
|
//1.验证本平台是否存在账号
|
|
|
|
|
$is_user_info = M('user','tab_')->where(['account'=>$phone])->find();
|
|
|
|
|
if(!empty($is_user_info)){
|
|
|
|
|
$userService = new UserService();
|
|
|
|
|
if ($userService->isAccountExist($phone)) {
|
|
|
|
|
$this->set_message(1017, '用户名已存在');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//2.验证其他平台是否存在账号
|
|
|
|
|
$domain = C('UC_OTHER_WEB_URL');
|
|
|
|
|
if(!empty($domain)){
|
|
|
|
|
$url = "http://{$domain}/Api/user/checkUserName?account={$phone}";
|
|
|
|
|
$check_res = json_decode(file_get_contents($url),true);
|
|
|
|
|
if($check_res['status']==0){
|
|
|
|
|
$this->set_message(1017, '用户名已存在');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//3.ucenter注册账号
|
|
|
|
|
$ucresult = uc_user_checkname($phone);
|
|
|
|
|
if($ucresult == -1) {
|
|
|
|
@ -620,15 +596,6 @@ class UserController extends BaseController
|
|
|
|
|
if($ucresult == -1) {
|
|
|
|
|
return $this->ajaxReturn(array('status'=>-2,'msg'=>'原密码错误'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 同步修改其他站点用户密码
|
|
|
|
|
*/
|
|
|
|
|
$domain = C('UC_OTHER_WEB_URL');
|
|
|
|
|
if(!empty($domain)){
|
|
|
|
|
$url = "http://{$domain}/Api/user/editPassword?account={$username}&oldpsw={$old_pwd}&newpsw={$new_pwd}";
|
|
|
|
|
$aa = json_decode(file_get_contents($url),true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$result = D('User')->changePwd(USER_ACCOUNT, $old_pwd, $new_pwd);
|
|
|
|
|
if($result==2){
|
|
|
|
|