From fd2c3015e995dbbb5d556825adc5e38b2c10677c Mon Sep 17 00:00:00 2001 From: "HDM58\\hdm58" Date: Tue, 12 Dec 2023 17:53:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BD=BF=E7=94=A8=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E3=80=81=E6=89=8B=E6=9C=BA=E5=8F=B7=E7=A0=81=E3=80=81=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/home/controller/Login.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/home/controller/Login.php b/app/home/controller/Login.php index d82ff52..8d0de10 100644 --- a/app/home/controller/Login.php +++ b/app/home/controller/Login.php @@ -32,12 +32,9 @@ class Login return to_assign(1, $e->getError()); } - $admin = Db::name('Admin')->where(['username' => $param['username']])->find(); + $admin = Db::name('Admin')->where(['username|mobile|email' => $param['username']])->find(); if (empty($admin)) { - $admin = Db::name('Admin')->where(['mobile' => $param['username']])->find(); - if (empty($admin)) { - return to_assign(1, '用户名或手机号码错误'); - } + return to_assign(1, '用户名或手机号码错误'); } $param['pwd'] = set_password($param['password'], $admin['salt']); if ($admin['pwd'] !== $param['pwd']) {