【发布时间】:2017-09-14 06:06:30
【问题描述】:
我使用 Laravel 文档安装了 Laravel Passport,Laravel 版本是 5.4。
到目前为止一切正常,现在我将这些行添加到我的视图中:
<!-- let people make clients -->
<passport-clients></passport-clients>
<!-- list of clients people have authorized to access our account -->
<passport-authorized-clients></passport-authorized-clients>
<!-- make it simple to generate a token right in the UI to play with -->
<passport-personal-access-tokens></passport-personal-access-tokens>
UI 看起来不错,但如果我尝试添加新的客户端或令牌,我会收到以下消息:
哎呀!出了点问题!
Something went wrong. Please try again.
我的 Chrome 开发控制台显示以下内容:
GET http://192.168.3.80/oauth/tokens 404 (Not Found) app.js:1175
GET http://192.168.3.80/oauth/personal-access-tokens 404 (Not Found) app.js:1175
GET http://192.168.3.80/oauth/scopes 404 (Not Found) app.js:1175
我按照文档中的步骤进行操作:https://laravel.com/docs/5.4/passport
之后,我按照视频中的步骤进行操作,但仍然无法正常工作。 https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/13
如果我按下按钮,我会在开发控制台中收到此帖子错误:
POST http://localhost/oauth/clients 404(未找到) 发布http://localhost/oauth/clients 404(未找到) 发布http://localhost/oauth/clients 404(未找到)
所以是路径的原因?
vue 文件显示如下:
客户端.vue
store() {
this.persistClient(
'post', '/oauth/clients',
this.createForm, '#modal-create-client'
);
},
【问题讨论】:
-
在你的
.env文件中设置APP_DEBUG=true,这样你就可以看到详细的错误了。 -
设置为true 哪里可以看到详细的?
-
那么你应该在
Whoops! Something went wrong!之后看到一个详细的日志。 -
artisan route:list打印什么? -
您的
AuthServiceProvider中的boot()方法的末尾应该有Passport::routes();。你检查了吗?
标签: php laravel vue.js laravel-5.4 laravel-passport