|
|
|
@ -473,14 +473,24 @@ eof;
@@ -473,14 +473,24 @@ eof;
|
|
|
|
|
//TODO: 验证短信验证码是否正确 |
|
|
|
|
|
|
|
|
|
if (empty($err)) { //如果数据检查通过,尝试注册新用户 |
|
|
|
|
$newUser = Common::saveUserIntoSession($cellphone, $friends_code); |
|
|
|
|
if (!empty($newUser)) { |
|
|
|
|
Common::saveFriendsCode($cellphone); |
|
|
|
|
Common::initUserData($cellphone, $friends_code); |
|
|
|
|
$userDataDir = Common::getUserDataDir($cellphone); |
|
|
|
|
if (empty($userDataDir)) { |
|
|
|
|
$newUser = Common::saveUserIntoSession($cellphone, $friends_code); |
|
|
|
|
if (!empty($newUser)) { |
|
|
|
|
Common::saveFriendsCode($cellphone); |
|
|
|
|
Common::initUserData($cellphone, $friends_code); |
|
|
|
|
|
|
|
|
|
$shareUrl = "/{$cellphone}/"; |
|
|
|
|
$msg = "注册完成,开始收藏你喜欢的视频吧,正在为你跳转到专属网址..."; |
|
|
|
|
$code = 1; |
|
|
|
|
}else { |
|
|
|
|
$err = '注册失败,请稍后再试'; |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
$shareUrl = "/{$cellphone}/"; |
|
|
|
|
$msg = "已注册,正在为你跳转到专属网址..."; |
|
|
|
|
$code = 1; |
|
|
|
|
} |
|
|
|
|
$msg = "注册完成,开始收藏你喜欢的视频吧,正在为你跳转到专属网址..."; |
|
|
|
|
$code = 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -503,6 +513,7 @@ eof;
@@ -503,6 +513,7 @@ eof;
|
|
|
|
|
$code = 0; |
|
|
|
|
$msg = ''; |
|
|
|
|
$err = ''; |
|
|
|
|
$shareUrl = ''; |
|
|
|
|
|
|
|
|
|
//用户提交的数据检查 |
|
|
|
|
$postParams = $this->post(); |
|
|
|
@ -514,18 +525,26 @@ eof;
@@ -514,18 +525,26 @@ eof;
|
|
|
|
|
$err = "请填写注册邀请码、手机号码和短信验证码哦"; |
|
|
|
|
}else if (Common::isCellphoneNumber($cellphone) == false) { |
|
|
|
|
$err = "手机号码格式错误,请填写正确的手机号码"; |
|
|
|
|
}else if (Common::getUserDataDir($cellphone) == false) { |
|
|
|
|
$err = "{$cellphone}还没注册哦,先去注册吧"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//TODO: 验证短信验证码是否正确 |
|
|
|
|
|
|
|
|
|
if (empty($err)) { //如果数据检查通过,尝试登录 |
|
|
|
|
$newUser = Common::saveUserIntoSession($cellphone); |
|
|
|
|
$msg = "登录成功,开始收藏你喜欢的视频吧"; |
|
|
|
|
$code = 1; |
|
|
|
|
if (!empty($newUser)) { |
|
|
|
|
$shareUrl = "/{$cellphone}/"; |
|
|
|
|
|
|
|
|
|
$msg = "登录成功,开始收藏你喜欢的视频吧"; |
|
|
|
|
$code = 1; |
|
|
|
|
}else { |
|
|
|
|
$err = '登录失败,请稍后重试'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->renderJson(compact('code', 'msg', 'err')); |
|
|
|
|
return $this->renderJson(compact('code', 'msg', 'err', 'shareUrl')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|