重构 monorepo 并完善网页端订阅与首页体验
- 迁移为 frontend-web、frontend-electron、backend-web 与 docker 部署结构 - 网页端:订阅门禁二次弹窗、套餐/支付组件化、顶栏分组对齐 - 首页:最近文件与模板库布局优化,缩略图对齐,下载与删除操作 - 新增管理后台、支付与云端文件 API,更新 README 与项目规范 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
$publicRoot = '/var/www/public';
|
||||
$uri = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ?: '/';
|
||||
|
||||
if ($uri === '/health') {
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
echo 'ok';
|
||||
return true;
|
||||
}
|
||||
|
||||
$file = $publicRoot . $uri;
|
||||
if ($uri !== '/' && is_file($file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (preg_match('#^/api/admin(/.*)?$#', $uri)) {
|
||||
require $publicRoot . '/admin.php';
|
||||
return true;
|
||||
}
|
||||
|
||||
if (preg_match('#^/api/v1(/.*)?$#', $uri)) {
|
||||
require $publicRoot . '/index.php';
|
||||
return true;
|
||||
}
|
||||
|
||||
http_response_code(404);
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode(['ok' => false, 'error' => 'not_found', 'message' => 'Not found'], JSON_UNESCAPED_UNICODE);
|
||||
return true;
|
||||
Reference in New Issue
Block a user