优化直接访问API端口地址返回404不泄漏信息
This commit is contained in:
15
server/app/view/404.html
Normal file
15
server/app/view/404.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?= $message ?></title>
|
||||
<style>
|
||||
body { font-family: system-ui, sans-serif; text-align: center; margin-top: 4rem; color: #333; }
|
||||
h1 { font-size: 1.5rem; font-weight: 600; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1><?= $message ?></h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -53,3 +53,6 @@ Route::group('/api', function () {
|
||||
})->middleware([
|
||||
TokenMiddleware::class,
|
||||
]);
|
||||
|
||||
// 关闭主应用默认路由(/controller/action 隐式映射),未在本文件显式注册的路径返回 404
|
||||
Route::disableDefaultRoute('');
|
||||
|
||||
@@ -12,3 +12,5 @@ Route::group('/tool/install', function () {
|
||||
Route::get('/online/storeAppVersions', [plugin\saipackage\app\controller\InstallController::class, 'storeAppVersions']);
|
||||
Route::post('/online/storeDownloadApp', [plugin\saipackage\app\controller\InstallController::class, 'storeDownloadApp']);
|
||||
});
|
||||
|
||||
Route::disableDefaultRoute('saipackage');
|
||||
|
||||
Reference in New Issue
Block a user