fix(config): 将前端访问开关限制为仅控制首页

移除用户前端开关对订阅入口、用户 API 与访客接口的拦截,
关闭 `frontend_enable` 时仅让用户首页 `/` 返回空 404。

同时更新后台配置文案、测试用例与模块文档,明确 API、
订阅和节点接口保持原有访问边界。
This commit is contained in:
yinjianm
2026-04-29 16:49:11 +08:00
parent 7a1cba4553
commit f70dbe4378
15 changed files with 39 additions and 33 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ class ClientRoute
{
$router->group([
'prefix' => 'client',
'middleware' => ['user.frontend', 'client']
'middleware' => 'client'
], function ($router) {
// Client
$router->get('/subscribe', [ClientController::class, 'subscribe'])->name('client.subscribe.legacy');
+4 -8
View File
@@ -14,18 +14,14 @@ class GuestRoute
$router->group([
'prefix' => 'guest'
], function ($router) {
$router->group([
'middleware' => 'user.frontend'
], function ($router) {
// Plan
$router->get('/plan/fetch', [PlanController::class, 'fetch']);
// Comm
$router->get('/comm/config', [CommController::class, 'config']);
});
// Plan
$router->get('/plan/fetch', [PlanController::class, 'fetch']);
// 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']);
});
}
}
+1 -2
View File
@@ -10,8 +10,7 @@ class PassportRoute
public function map(Registrar $router)
{
$router->group([
'prefix' => 'passport',
'middleware' => 'user.frontend'
'prefix' => 'passport'
], function ($router) {
// Auth
$router->post('/auth/register', [AuthController::class, 'register']);
+1 -1
View File
@@ -22,7 +22,7 @@ class UserRoute
{
$router->group([
'prefix' => 'user',
'middleware' => ['user.frontend', 'user']
'middleware' => 'user'
], function ($router) {
// User
$router->get('/resetSecurity', [UserController::class, 'resetSecurity']);