Auth::guard ('API')->attempt ($credentials)) 到底是什么?
if (!$token = \Auth::guard('api')->attempt($credentials)) {
return $this->response->errorUnauthorized('用户名或密码错误');
}
attempt 不是根据数据库中的值进行比对返回true or false 么。为什么这里返回token。 教程还说能返回过期时间。。求指点代码看的有点蒙逼。
推荐文章: