0

火花注册页面显示正常。我填写表格,提交,数据库中有一个新条目。

调用函数获取当前用户:

$router->get('/user/current', 'Laravel\Spark\Http\Controllers\UserController@current');

随着控制器...

 /**
 * Get the current user of the appliation.
 *
 * @return Response
 */
public function current()
{
    return response()->json(Auth::check());
}

Auth::check()返回错误。而Auth::user()在这个地方,什么也没有返回。

以该用户身份通过​​ spark 登录页面登录具有相同的结果。

但是,返回登录或注册页面会重新路由我,就好像我已登录一样。我还可以浏览 spark 设置页面并添加新团队等。

为什么 spark 认为我已登录,为什么它实际上并没有让我登录?

4

1 回答 1

0

所以,问题在于该应用程序一直在使用 gulp 来服务和构建它。现在应用程序已启动并运行并通过 php artisan serve 命令提供服务,它不再可以通过 URL 访问192.168.10.10/...,现在通过localhost:8000/...

问题是调用192...没有产生错误,所以我没有想到要检查它。

@约书亚

于 2016-10-21T09:15:15.930 回答