larvel 中的api.php_请问 Laravel 中 routes/api.php 自带的 /user 路由是做什么用的?

@likunyan

下面是刚刚请求运行时产生的日志,我看日志中有提示 Route [login] not defined 我也一同创建了一个 Route::get('/login',function(){var_dump(1);}); 路由,并重新访问,也并未解决问题

[2019-12-08 07:19:38] local.ERROR: Route [login] not defined. {"exception":"[object] (Symfony\\Component\\Routing\\Exception\\RouteNotFoundException(code: 0): Route [login] not defined. at C:\

uanjian\\PHPStudy\\PHPTutorial\\WWW\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\UrlGenerator.php:420)

[stacktrace]

#0 C:\

uanjian\\PHPStudy\\PHPTutorial\\WWW\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\helpers.php(782): Illuminate\\Routing\\UrlGenerator->route('login', Array, true)

#1 C:\

uanjian\\PHPStudy\\PHPTutorial\\WWW\\laravel\\app\\Http\\Middleware\\Authenticate.php(18): route('login')

#2 C:\

uanjian\\PHPStudy\\PHPTutorial\\WWW\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Auth\\Middleware\\Authenticate.php(82): App\\Http\\Middleware\\Authenticate->redirectTo(Object(Illuminate\\Http\\Request))

#3 C:\

uanjian\\PHPStudy\\PHPTutorial\\WWW\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Auth\\Middleware\\Authenticate.php(67): Illuminate\\Auth\\Middleware\\Authenticate->unauthenticated(Object(Illuminate\\Http\\Request), Array)

#4 C:\

uanjian\\PHPStudy\\PHPTutorial\\WWW\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Auth\\Middleware\\Authenticate.php(41): Illuminate\\Auth\\Middleware\\Authenticate->authenticate(Object(Illuminate\\Http\\Request), Array)

#5 C:\

uanjian\\PHPStudy\\PHPTutorial\\WWW\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(171): Illuminate\\Auth\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure), 'api')

#6 C:\

uanjian\\PHPStudy\\PHPTutorial\\WWW\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

"}

你可能感兴趣的:(larvel,中的api.php)