From fbbc69f80a097a90815d023fbc7e48b15ecde11a Mon Sep 17 00:00:00 2001 From: WispX Date: Wed, 28 Jul 2021 10:27:22 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Auth.php | 4 ++-- application/index/view/auth/login.html | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/application/index/controller/Auth.php b/application/index/controller/Auth.php index 4b9d2ed1..46e5a5f8 100644 --- a/application/index/controller/Auth.php +++ b/application/index/controller/Auth.php @@ -14,11 +14,11 @@ use think\facade\Session; class Auth extends Base { - public function login($type = null, $account = null, $password = null) + public function login($account = null, $password = null) { if ($this->request->isPost()) { try { - Users::login($account, $password, $type); + Users::login($account, $password, filter_var($account, FILTER_VALIDATE_EMAIL) ? 'email' : 'username'); } catch (Exception $e) { Session::flash('error', $e->getMessage()); return $this->fetch(); diff --git a/application/index/view/auth/login.html b/application/index/view/auth/login.html index 2bd89b20..e48e8a0c 100644 --- a/application/index/view/auth/login.html +++ b/application/index/view/auth/login.html @@ -16,13 +16,6 @@
{include file="common:alert"} -
- - -