修改网站注册

master
ELF 5 years ago
parent 744cbcf7ea
commit d9cc82f73a

@ -831,15 +831,6 @@ class UserModel extends Model{
if( C('UC_OPEN')==1 ){
$res = uc_user_edit($user['account'],'',$data['password'],'',1);
if($res != 1) {return false;}
/**
* 同步修改其他站点用户密码
*/
$domain = C('UC_OTHER_WEB_URL');
$username = get_user_account($data['id']);
if(!empty($domain)){
$url = "http://{$domain}/Api/user/editPassword?account={$username}&type=1&newpsw={$data['password']}";
$aa = json_decode(file_get_contents($url),true);
}
}
$u_map['uid']=$data['id'];

@ -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,21 +281,9 @@ 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){
$this->set_message(1017, '用户名已存在');
}
$userService = new UserService();
if ($userService->isAccountExist($account)) {
$this->set_message(1017, '用户名已存在');
}
//3.ucenter注册账号
@ -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){

@ -0,0 +1,17 @@
<?php
namespace Base\Service;
use Base\Facade\Request;
class UserService {
public function isAccountExist($account)
{
$user = M('user', 'tab_')->where(['_logic' => 'or', 'account' => $account, 'phone' => $account])->find();
if ($user) {
return true;
}
return false;
}
}

@ -9,7 +9,7 @@ use Org\XiguSDK\Xigu;
use Org\UcenterSDK\Ucservice;
use Admin\Controller;
use Base\Service\UserService;
use Org\ThinkSDK\ThinkOauth;
use Com\Wechat;
use Com\WechatAuth;
@ -373,14 +373,6 @@ class MemberController extends BaseController {
if($ucresult == -1) {
$this->ajaxReturn(array('status'=>0,'msg'=>'原密码错误'));exit;
}
/**
* 同步修改其他站点用户密码
*/
$domain = C('UC_OTHER_WEB_URL');
if(!empty($domain)){
$url = "http://{$domain}/Api/user/editPassword?account={$username}&oldpsw={$opwd}&newpsw={$pwd}";
$aa = json_decode(file_get_contents($url),true);
}
}
$member = new MemberApi();
@ -924,23 +916,11 @@ class MemberController extends BaseController {
/**是否开启ucenter**/
if(C('UC_OPEN')==1){
//Ucenter注册
//1.验证本平台是否存在账号
$is_user_info = M('user','tab_')->where(['account'=>$_POST['uname']])->find();
if(!empty($is_user_info)){
$userService = new UserService();
if ($userService->isAccountExist($_POST['uname'])) {
return $this->ajaxReturn(array('status'=>0,'msg'=>'用户名已存在'));
}
//2.验证其他平台是否存在账号
$domain = C('UC_OTHER_WEB_URL');
if(!empty($domain)){
$url = "http://{$domain}/Api/user/checkUserName?account={$_POST['uname']}";
$check_res = json_decode(file_get_contents($url),true);
if($check_res['status']==0){
$this->ajaxReturn(array('status'=>0,'msg'=>'注册失败,用户名已存在'));exit;
}
}
//3.ucenter注册账号
$ucresult = uc_user_checkname($_POST['uname']);
if($ucresult == -1) {
@ -1174,24 +1154,11 @@ class MemberController extends BaseController {
/**是否开启ucenter**/
if(C('UC_OPEN')==1){
//Ucenter注册
//1.验证本平台是否存在账号
$is_user_info = M('user','tab_')->where(['account'=>$_POST['telnum']])->find();
if(!empty($is_user_info)){
$userService = new UserService();
if ($userService->isAccountExist($_POST['telnum'])) {
return $this->ajaxReturn(array('status'=>0,'msg'=>'用户名已存在'));
}
//2.验证其他平台是否存在账号
$domain = C('UC_OTHER_WEB_URL');
if(!empty($domain)){
$url = "http://{$domain}/Api/user/checkUserName?account={$_POST['account']}";
$check_res = json_decode(file_get_contents($url),true);
if($check_res['status']==0){
$this->ajaxReturn(array('status'=>0,'msg'=>'注册失败,用户名已存在'));exit;
}
}
//3.ucenter注册账号
$ucresult = uc_user_checkname($_POST['telnum']);
if($ucresult == -1) {

@ -37,6 +37,13 @@
<div class="collaborate_info">
<div class="title">市场合作</div>
<div class="del">万盟天下一直坚持开放诚信高效的业务合作,欢迎各位业界同仁前来联系,互利共赢。</div>
<div class="del" style="display: flex; align-items: center;margin-top:0">
<div>
<div class="del" style="margin: 0;">联系人: 李先生</div>
<div class="del" style="margin-bottom: 0;">微信号lh19820409lh</div>
</div>
<img src="__IMG__/hezuo_qrcode.png" alt="" style="width: 1.2rem;height: 1.2rem;margin-left: 0.4rem;">
</div>
</div>
<div class="collaborate_info">
<div class="title">商务合作</div>

@ -5,6 +5,7 @@ use User\Api\MemberApi;
use User\Api\SuserApi;
use Think\Log;
use Base\Service\ApplyService;
use Base\Service\UserService;
use Base\Tool\TaskClient;
use Base\Facade\Request;
@ -195,21 +196,10 @@ class CommonController extends BaseController {
public function doRegister($account, $password ,$phone, $promote_id, $register_way, $register_type, $game_id = 0)
{
//验证账号
$user = M('user', 'tab_')->where(['account' => $account])->find();
if (!empty($user)) {
$userService = new UserService();
if ($userService->isAccountExist($account)) {
$this->respondError('用户名已存在');
}
//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) {
$this->respondError('用户名已存在');
}
}
$data = [
'account' => $account,

@ -8,6 +8,7 @@ use Think\Log;
use Base\Service\GameService;
use Base\Service\PackageDownloadLogService;
use Base\Facade\Request;
use Base\Service\UserService;
class SsgController extends BaseController {
const USER_NOT_ILLEGAL = -1; //用户名不合法
@ -265,21 +266,10 @@ class SsgController extends BaseController {
//真正注册代码
public function doRegister($account,$password,$phone,$promote_id,$register_way,$register_type, $game_id = 0)
{
//验证账号
$is_user_info = M('user', 'tab_') -> where(['account' => $account]) -> find();
if (!empty($is_user_info)) {
$userService = new UserService();
if ($userService->isAccountExist($account)) {
$this -> set_message(1017, "fail", "用户名已存在");
}
//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) {
$this -> set_message(1017, "fail", "用户名已存在");
}
}
$data = array(
'account' => $account,
'password' => think_ucenter_md5($password, UC_AUTH_KEY),

@ -9,6 +9,7 @@ use User\Api\MemberApi;
use Admin\Model\PointTypeModel;
use Think\Log;
use Base\Tool\TaskClient;
use Base\Service\UserService;
class UserController extends BaseController
{
@ -345,25 +346,11 @@ class UserController extends BaseController
/**是否开启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)) {
return $this->ajaxReturn(array('status' => 0, 'msg' => '用户名已存在'));
}
//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->ajaxReturn(array('status' => 0, 'msg' => '注册失败,用户名已存在'));
exit;
}
}
//3.ucenter注册账号
$ucresult = uc_user_checkname($phone);
if ($ucresult == -1) {
@ -478,25 +465,11 @@ class UserController extends BaseController
/**是否开启ucenter**/
if (C('UC_OPEN') == 1) {
//Ucenter注册
//1.验证本平台是否存在账号
$is_user_info = M('user', 'tab_')->where(['account' => $_POST['account']])->find();
if (!empty($is_user_info)) {
$userService = new UserService();
if ($userService->isAccountExist($account)) {
return $this->ajaxReturn(array('status' => 0, 'msg' => '用户名已存在'));
}
//2.验证其他平台是否存在账号
$domain = C('UC_OTHER_WEB_URL');
if (!empty($domain)) {
$url = "http://{$domain}/Api/user/checkUserName?account={$_POST['account']}";
$check_res = json_decode(file_get_contents($url), true);
if ($check_res['status'] == 0) {
$this->ajaxReturn(array('status' => 0, 'msg' => '注册失败,用户名已存在'));
exit;
}
}
//3.ucenter注册账号
$ucresult = uc_user_checkname($_POST['account']);
if ($ucresult == -1) {
@ -1115,16 +1088,6 @@ class UserController extends BaseController
if ($ucresult == -1) {
$this->error("原始密码不正确");
}
/**
* 同步修改其他站点用户密码
*/
$domain = C('UC_OTHER_WEB_URL');
if (!empty($domain)) {
$url = "http://{$domain}/Api/user/editPassword?account={$username}&oldpsw={$_POST['old_pwd']}&newpsw={$_POST['new_pwd']}";
$aa = json_decode(file_get_contents($url), true);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Loading…
Cancel
Save