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 @@