xieruidong 2 năm trước cách đây
mục cha
commit
48c0917421
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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;