Laravel 7 + vuejs 多重身份验证 /admin 路由不起作用

时间:2021-01-16 12:22:35

标签: php laravel vue.js authentication

我是 vuejs 的新手,我正在准备 Laravel 7 多重身份验证工作。在这项工作中,我用 vuejs 做前端部分。问题是路由部分:

Route::get('/{any}/', 'Front\IndexController@index')->where('any', '. *');

当我将其写入 routes \ web 并输入 localhost:8000/adminlocalhost:8000/admin/register 时,管理页面不会出现,但是当我输入 localhost:8000/loginlocalhost:8000/register 时,没有问题。 如果我删除路由部分,管理页面正在工作,但这次每当我刷新页面时,vuejs 路由都会给出 404 错误。

我们不能这样做吗:

Route::get('/{any}/', 'Front\IndexController@index')->where('any', '. *-Not-> /admin/ and /admin/login/ and /admin/register and /admin/index and /admin/user etc.');

我根据这个项目做了工作: https://github.com/samironbarai/laravel-7-multi-auth.git

1 个答案:

答案 0 :(得分:-1)

最后我解决了这个问题。 1-删除此:Route::get('/{any}/', 'Front\IndexController@index')->where('any', '. *'); 在 route\web.php 中。 2-Delete this on app.js

3- Paste this on app.js

and this

由于我是 Stackoverflow 的新手,我无法很好地解释它,但我就是这样解决的。

相关问题