feat: 人机验证可开关 + 登录注册入口白名单
- 系统设置新增「人机验证」页: 总开关 + 按入口勾选 - 客户端 verify/activate/check-update 永不校验 Turnstile - 公开 GET /api/public/turnstile-config 供登录页按需展示组件
This commit is contained in:
1 parent
217c083544
commit
7c85ecdd2d
9 files changed
+262
-21
No files matched your search
@@ -6,6 +6,7 @@ use App\Core\Database;
|
||||
use App\Core\Validator;
|
||||
use App\Services\InstallationService;
|
||||
use App\Services\VersionService;
|
||||
use App\Services\TurnstileService;
|
||||
|
||||
/**
|
||||
* 公开接口控制器
|
||||
@@ -746,6 +747,21 @@ class PublicController extends Controller
|
||||
$this->success(['valid' => false, 'message' => '卡密状态异常'], 'ok');
|
||||
}
|
||||
|
||||
/**
|
||||
* 人机验证公开配置(前端登录页判断是否展示组件)
|
||||
* GET /api/public/turnstile-config
|
||||
* 注意:客户端 verify/activate/check-update 等接口从不校验 Turnstile
|
||||
*/
|
||||
public function turnstileConfig(): void
|
||||
{
|
||||
$c = \App\Services\TurnstileService::config();
|
||||
$this->success([
|
||||
'enabled' => $c['enabled'] === 1 && $c['site_key'] !== '',
|
||||
'site_key' => $c['site_key'],
|
||||
'endpoints' => $c['endpoints'],
|
||||
], 'ok');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公告列表(公开/客户端)
|
||||
* GET /api/public/announcements?target=client&project_id=1&limit=10
|
||||
|
||||
Reference in new issue
Block a user