From 0ad3b20a4e011f65caecc0bd40b7659113932c5e Mon Sep 17 00:00:00 2001 From: liqi Date: Fri, 10 Jan 2025 13:37:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E4=B8=BA=E4=BA=86=E6=B5=8B=E8=AF=95=E6=9A=82=E6=97=B6=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E9=AA=8C=E8=AF=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/controllers/LoginController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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()) {