首页 > 解决方案 > 部署后无法刷新或回到以前的角度

问题描述

我刚刚将我的 angular 6 项目集成到 laravel 5.4 中。

我遵循了正常的 Laravel 模板,在这里我将我的角度index.html代码放在了 welcome.blade.php 中,它运行良好。我还将资产放在公用文件夹中。然后我将整个东西部署在共享服务器上。

遇到的问题是部署后,我无法刷新或返回上一页。我什至无法直接在浏览器中手动导航到 url。我需要一种方法让 laravel 每次我服务请求时总是加载welcome.blade.php。

感谢您的任何帮助。

这是我的 web.php

 <?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

然后 api.php

    <?php
Route::group([

    'middleware' => 'api'

], function () {

    Route::post('login', 'AuthController@login');
    Route::post('signup', 'AuthController@signup');
    Route::post('logout', 'AuthController@logout');
    Route::post('refresh', 'AuthController@refresh');
    Route::post('me', 'AuthController@me');

});

那是从 .

我的welcome.blade.php 包含有角度的index.html 代码

标签: phpangularlaravel

解决方案


我设法解决了它。答案其实就在这里。非常感谢。


推荐阅读