|
|
@@ -57,6 +57,7 @@ class Auth
|
|
|
public function attempt($condition)
|
|
|
{
|
|
|
$user = $this->authenticate($condition);
|
|
|
+
|
|
|
// 用户存在性
|
|
|
if (!$user) {
|
|
|
throw new FailedException([
|
|
|
@@ -142,6 +143,7 @@ class Auth
|
|
|
*/
|
|
|
protected function jwt($user)
|
|
|
{
|
|
|
+ var_dump($user);
|
|
|
$token = JWTAuth::builder([$this->jwtKey() => $user->id]);
|
|
|
|
|
|
JWTAuth::setToken($token);
|
|
|
@@ -257,7 +259,7 @@ class Auth
|
|
|
$where = [];
|
|
|
foreach ($condition as $field => $value) {
|
|
|
if ($field == 'captcha') continue;
|
|
|
- if (in_array($field,['username','email','open_id']))
|
|
|
+ if (in_array($field,['username','mobile','email','open_id']))
|
|
|
$where[$field] = preg_replace('# #','',$value);
|
|
|
}
|
|
|
return $where;
|