xieruidong 2 years ago
parent
commit
48c0917421
1 changed files with 1 additions and 1 deletions
  1. 1 1
      application/common/library/Auth.php

+ 1 - 1
application/common/library/Auth.php

@@ -211,7 +211,7 @@ class Auth
     public function login($account, $password,$extra=[])
     {
         $field = Validate::is($account, 'email') ? 'email' : (Validate::regex($account, '/^1\d{10}$/') ? 'mobile' : 'username');
-        $user = User::where([$field => $account])->where($extra)->find();
+        $user = User::where('username|mobile',$account)->where($extra)->find();
         if (!$user) {
             $this->setError('Account is incorrect');
             return false;