|
|
|
@ -58,6 +58,16 @@ Class FrontApiController extends SiteController {
@@ -58,6 +58,16 @@ Class FrontApiController extends SiteController {
|
|
|
|
|
throw new Exception('Oops,操作太快了,请喝杯咖啡休息会吧...'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//只允许添加到自己的收藏夹 |
|
|
|
|
$loginedUser = Common::getUserFromSession(); |
|
|
|
|
if (empty($loginedUser['username'])) { |
|
|
|
|
throw new Exception('Oops,你还没登录哦'); |
|
|
|
|
}else if ( |
|
|
|
|
!empty(FSC::$app['config']['multipleUserUriParse']) |
|
|
|
|
&& (empty(FSC::$app['user_id']) || FSC::$app['user_id'] != $loginedUser['username']) |
|
|
|
|
) { |
|
|
|
|
throw new Exception('Oops,请求地址有误'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$content = $this->post('content', ''); |
|
|
|
|
$title = $this->post('title', ''); |
|
|
|
@ -470,6 +480,7 @@ eof;
@@ -470,6 +480,7 @@ eof;
|
|
|
|
|
$postParams = $this->post(); |
|
|
|
|
if (!empty($postParams)) { |
|
|
|
|
$cellphone = $this->post('phoneNum', ''); |
|
|
|
|
$action = $this->post('action', 'register'); |
|
|
|
|
|
|
|
|
|
if (empty($cellphone) || Common::isCellphoneNumber($cellphone) == false) { |
|
|
|
|
$err = "手机号码格式错误,请填写正确的手机号码"; |
|
|
|
@ -477,7 +488,7 @@ eof;
@@ -477,7 +488,7 @@ eof;
|
|
|
|
|
$params = array( |
|
|
|
|
'phoneNumber' => $cellphone, |
|
|
|
|
'codeNumber' => $this->generateRandSmsCode(), |
|
|
|
|
'action' => 'register', |
|
|
|
|
'action' => $action, |
|
|
|
|
); |
|
|
|
|
$params['sign'] = $this->sign($params, FSC::$app['config']['service_3rd_api_key']); |
|
|
|
|
|
|
|
|
@ -607,7 +618,7 @@ eof;
@@ -607,7 +618,7 @@ eof;
|
|
|
|
|
if (empty($err)) { //如果数据检查通过,尝试登录 |
|
|
|
|
$newUser = Common::saveUserIntoSession($cellphone); |
|
|
|
|
if (!empty($newUser)) { |
|
|
|
|
$shareUrl = "/{$cellphone}/"; |
|
|
|
|
$shareUrl = "/{$newUser['username']}/"; |
|
|
|
|
|
|
|
|
|
$msg = "登录成功,开始收藏你喜欢的视频吧"; |
|
|
|
|
$code = 1; |
|
|
|
|