我尝试了一个带有laravel-passport的vue-lumen-tutorial。除了LoginController (通过用户和密码登录)之外,所有的工具都可以正常工作。我认为这不是教程代码的问题,它更多的是服务器或幼体/流明配置的问题。但我不确定。代码在linux机器(18.04)、带有Lumen (5.8.12) (Laravel Components 5.8.*)和Passport的apache服务器上远程运行。api终结点可用,但/login终结点显示404 Not found。
我在这里找到了一些关于流明或.htaccess文件的index.php的问题/答案。Just installed Lumen and got NotFoundHttpException。但这对我没什么帮助。
我正在使用Postman进行测试:
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?这里是第45行的LoginController:https://github.com/aibim/vue-lumen-tutorial/blob/master/app/Http/Controllers/LoginController.php
发布于 2019-10-24 23:21:27
我发现了错误。APP_URL路径.env错误。我
wrong: APP_URL=https://domain.de/public/
right: APP_URL=https://domain.de/https://stackoverflow.com/questions/58510682
复制相似问题