【问题标题】:Laravel 7 + vuejs multiple authentication /admin route is not workingLaravel 7 + vuejs 多重身份验证/管理路由不起作用
【发布时间】:2021-04-21 06:42:38
【问题描述】:

我是 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

【问题讨论】:

    标签: php laravel vue.js authentication


    【解决方案1】:

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

    3-Paste this on app.js

    and this

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-19
      • 2016-04-28
      • 2018-07-25
      • 1970-01-01
      • 2018-05-12
      • 2017-01-07
      • 2020-03-13
      • 2016-10-21
      相关资源
      最近更新 更多