我尝试了使用laravel-passport的vue-lumen-tutorial。除了LoginController(通过用户名和密码登录)之外,其他所有方法都对我有效。我认为这不是教程代码的问题,更多的是服务器或laravel / lumen配置问题。但是我不确定。该代码在Linux计算机(18.04),带有Lumen(5.8.12)(Laravel Components 5.8。*)和Passport的apache服务器上远程运行。api端点可用,但/ login端点给出404找不到。
[我在这里找到有关流明或.htaccess文件index.php的一些问题/答案。 Just installed Lumen and got NotFoundHttpException。但这对我没有帮助。
我正在与邮递员进行测试:
GET to https://domain/api/companies/ works fine,
POST to https://domain/api/oauth/token works fine, but
POST to https://domain/api/login gives a 404 Not found.
The route /login is ok.
...
return app()->version(); only for testing gives a request but i need the $tokenRequest:
...
return app()->dispatch($tokenRequest); => 404 Not found
...
error message:
(1/1) NotFoundHttpException
in RoutesRequests.php line 229
...
protected function handleDispatcherResponse($routeInfo)
{
switch ($routeInfo[0]) {
case Dispatcher::NOT_FOUND:
throw new NotFoundHttpException; <== 229
case Dispatcher::METHOD_NOT_ALLOWED:
throw new MethodNotAllowedHttpException($routeInfo[1]);
case Dispatcher::FOUND:
return $this->handleFoundRoute($routeInfo);
}
}
...
Maybe a proxy issue between /oauth/token and /login? What can i do?
LoginController在第45行:https://github.com/aibim/vue-lumen-tutorial/blob/master/app/Http/Controllers/LoginController.php
我发现了错误。 APP_URL路径.env错误。我
wrong: APP_URL=https://domain.de/public/
right: APP_URL=https://domain.de/