我是改过的,改成 user 表了,但是SQL语句查询的还是 users 表,并没有起作用。
另外啊,我用的是jwt github上的第一种认证方法 authenticate。
现在换一个方法可以了,谢谢!
public function authenticate(Request $request)
{
// grab credentials from the request
$credentials = $request->only('email', 'password');
try {
// attempt to verify the credentials and create a token for the user
if (! $token = JWTAuth::attempt($credentials)) {
return response()->json(['error' => 'invalid_credentials'], 401);
}
} catch (JWTException $e) {
// something went wrong whilst attempting to encode the token
return response()->json(['error' => 'could_not_create_token'], 500);
}
// all good so return the token
return response()->json(compact('token'));
}