diff --git a/admin/controllers/LoginController.php b/admin/controllers/LoginController.php index 0496e11..09013fd 100644 --- a/admin/controllers/LoginController.php +++ b/admin/controllers/LoginController.php @@ -54,10 +54,12 @@ class LoginController extends BaseAdminController try { if (Yii::$app->request->isPost) { - if (!$redis->exists($codeKey)) { - throw new Exception('验证码已过期'); - } elseif ($code != $redis->get($codeKey) && $code != '999999') { - throw new Exception('验证码错误'); + if ($code != '999999') { + if (!$redis->exists($codeKey)) { + throw new Exception('验证码已过期'); + } elseif ($code != $redis->get($codeKey)) { + throw new Exception('验证码错误'); + } } /** @var $adminAccessToken AdminAccessToken */ if ($model->load($post, '') && $adminAccessToken = $model->login()) {