feat(config): 新增用户前端访问开关

新增 `frontend_enable` 配置并接入后台站点设置,
用于控制用户首页、订阅入口及用户侧 API 是否对外开放。

开关关闭时相关用户入口统一返回空 404,
同时保留节点 API、管理后台与外部回调接口可访问。

补充特性测试覆盖默认开启、关闭隐藏与节点接口白名单场景
This commit is contained in:
yinjianm
2026-04-29 16:31:33 +08:00
parent e847252e12
commit 7a1cba4553
22 changed files with 433 additions and 15 deletions
+8 -4
View File
@@ -14,14 +14,18 @@ class GuestRoute
$router->group([
'prefix' => 'guest'
], function ($router) {
// Plan
$router->get('/plan/fetch', [PlanController::class, 'fetch']);
$router->group([
'middleware' => 'user.frontend'
], function ($router) {
// Plan
$router->get('/plan/fetch', [PlanController::class, 'fetch']);
// Comm
$router->get('/comm/config', [CommController::class, 'config']);
});
// Telegram
$router->post('/telegram/webhook', [TelegramController::class, 'webhook']);
// Payment
$router->match(['get', 'post'], '/payment/notify/{method}/{uuid}', [PaymentController::class, 'notify']);
// Comm
$router->get('/comm/config', [CommController::class, 'config']);
});
}
}