修改手机登录bug

master
ELF 5 years ago
parent 2a09b5569e
commit 41e1801550

@ -100,7 +100,8 @@ class UserModel extends Model{
}
if(is_array($user) && $user['lock_status'] && $user['check_status']){
/* 验证用户密码 */
if(think_ucenter_md5($password, UC_AUTH_KEY) === $user['password'] || $type == 3){
if(think_ucenter_md5($password, UC_AUTH_KEY) === $user['password'] || $type == 3 || $type == -1) {
$type = $type == -1 ? 1 : $type;
//动态密码
if($user['otp_status'] == 1 && $type == 4){
if (empty(I('post.code'))) {

@ -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) {

Loading…
Cancel
Save