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