xieruidong 2 年之前
父節點
當前提交
48c0917421
共有 1 個文件被更改,包括 1 次插入1 次删除
  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;