From 41e18015507170b61b60db91c66361c6e4e2595a Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Fri, 3 Apr 2020 11:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA=E7=99=BB?= =?UTF-8?q?=E5=BD=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Model/UserModel.class.php | 3 ++- .../Mobile/Controller/CommonController.class.php | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Model/UserModel.class.php b/Application/Admin/Model/UserModel.class.php index c3269cab4..79ee7bab4 100644 --- a/Application/Admin/Model/UserModel.class.php +++ b/Application/Admin/Model/UserModel.class.php @@ -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'))) { diff --git a/Application/Mobile/Controller/CommonController.class.php b/Application/Mobile/Controller/CommonController.class.php index 2300f5eb7..2a7b42f8d 100644 --- a/Application/Mobile/Controller/CommonController.class.php +++ b/Application/Mobile/Controller/CommonController.class.php @@ -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(); + $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) {