php - 部署后无法刷新或回到以前的角度
问题描述
我刚刚将我的 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 代码
解决方案
我设法解决了它。答案其实就在这里。非常感谢。
推荐阅读
- java - 如何捕获 2 个元素并合并它们?
- javascript - Chrome 扩展将被阻止的站点转发到 html 页面,但仅当链接直接写在搜索栏中
- android - 无法使用 Kotlin 将大图像从 android 上传到 node.js 服务器
- sql - 查询以仅检索姓氏以“K”开头的列
- sql - 修改 Postgres 查询以使用 generate_series 对几个连续范围间隔中的每一个进行总体求和
- android - 相机预览无法使用textureview android延迟
- python - 在 Python 的子模块的 init.py 文件中使用 import 语句
- mongodb - 如何通过在数组中搜索值来查询文档?
- android - 分享android上当前wifi的信息
- c# - FirebaseDataBase.Net (Xamarin.Form.Mobile) 可以更新并向所有用户通知实时数据吗?