|
|
|
@ -48,21 +48,22 @@ class CommonController extends BaseController {
|
|
|
|
|
$this->respondError('请输入账号');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$loginType = 1;
|
|
|
|
|
if ($mobile != '') {
|
|
|
|
|
$user = M('user', 'tab_')->field(['id', 'account'])->where(['phone' => $mobile])->find();
|
|
|
|
|
if (!$user) {
|
|
|
|
|
$this->respondError('手机号错误');
|
|
|
|
|
}
|
|
|
|
|
$account = $user->account;
|
|
|
|
|
if (!$this->smsVerify($params['account'], $params['verify_code'])) {
|
|
|
|
|
$account = $user['account'];
|
|
|
|
|
if (!$this->smsVerify($mobile, $verifyCode)) {
|
|
|
|
|
$this->respondError('验证失败');
|
|
|
|
|
}
|
|
|
|
|
$loginType = -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$promote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
|
|
|
|
|
|
|
|
|
|
$suserApi = new SuserApi();
|
|
|
|
|
$userId = $suserApi->login($account, $password, 1); //调用登录
|
|
|
|
|
$userId = $suserApi->login($account, $password, $loginType); //调用登录
|
|
|
|
|
$resMsg = "登录成功";
|
|
|
|
|
if ($userId <= 0) {
|
|
|
|
|
switch ($userId) {
|
|
|
|
|