You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
| Web Routes
|
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
|
|
|
|
| routes are loaded by the RouteServiceProvider and all of them will
|
|
|
|
|
|
| be assigned to the "web" middleware group. Make something great!
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
Route::get('/', function () {
|
|
|
|
|
|
return view('welcome');
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 管理后台 SPA:/admin/* 非静态文件时回退到 index.html(退出登录、刷新深链等)
|
|
|
|
|
|
Route::get('/admin/{path?}', function (?string $path = null) {
|
|
|
|
|
|
$index = public_path('admin/index.html');
|
|
|
|
|
|
abort_unless(is_file($index), 404);
|
|
|
|
|
|
|
|
|
|
|
|
return response()->file($index, ['Content-Type' => 'text/html; charset=UTF-8']);
|
|
|
|
|
|
})->where('path', '.*');
|