fix(captcha): wire scene switches and rename menu to 人机验证

- Admin: 登录权限 → 人机验证; 停用场景 → 启用场景 (opt-in)
- Normalize enabled_scenarios with legacy disabled_scenarios BC
- Sign-in: never soft-bypass captcha; cancel unlocks button
- Captcha JS: cancel path finishes pending callback as false
This commit is contained in:
2026-07-15 16:48:57 +08:00
parent 808d46664f
commit bc96edf384
10 changed files with 143 additions and 54 deletions
@@ -16,8 +16,8 @@ class AKSRT_Admin_Schema_Permissions {
'sections' => [
'login' => [
'key' => 'login',
'title' => '登录权限',
'version' => '1.0.0',
'title' => '人机验证',
'version' => '1.1.0',
'option_key' => 'aksrt_captcha_config',
'groups' => [
['key' => 'basic', 'title' => '基础开关', 'fields' => [
@@ -32,7 +32,7 @@ class AKSRT_Admin_Schema_Permissions {
['key' => 'mode', 'label' => '触发模式', 'type' => 'radio', 'default' => 'always', 'dependsOn' => ['key' => 'enabled', 'value' => true], 'options' => [
['label' => '始终显示', 'value' => 'always'],
]],
['key' => 'disabled_scenarios', 'label' => '停用场景', 'type' => 'checkbox', 'default' => [], 'dependsOn' => ['key' => 'enabled', 'value' => true], 'options' => [
['key' => 'enabled_scenarios', 'label' => '启用场景', 'type' => 'checkbox', 'default' => ['comment', 'login', 'register', 'bind', 'bind_phone', 'lostpassword', 'change_password', 'change_email', 'verify_email', 'download', 'signin'], 'dependsOn' => ['key' => 'enabled', 'value' => true], 'options' => [
['label' => '发表评论', 'value' => 'comment'],
['label' => '用户登录', 'value' => 'login'],
['label' => '用户注册', 'value' => 'register'],
@@ -138,7 +138,7 @@ class AKSRT_Admin_Schema_Permissions {
['key' => 'download_role_size', 'label' => '角色文件大小限制', 'type' => 'textarea', 'default' => '', 'help' => '格式: role|max_size_mb,每行一条'],
]],
['key' => 'captcha', 'title' => '安全设置', 'fields' => [
['key' => 'download_captcha_hint', 'label' => '下载验证码', 'type' => 'notice', 'alertType' => 'info', 'alertContent' => '下载验证码门槛在「功能&权限 → 下载权限」页(cms_features.download_captcha)维护;服务商与场景在「登录权限」。'],
['key' => 'download_captcha_hint', 'label' => '下载验证码', 'type' => 'notice', 'alertType' => 'info', 'alertContent' => '下载验证码门槛在「功能&权限 → 下载权限」页(cms_features.download_captcha)维护;服务商与场景在「人机验证」。'],
['key' => 'download_ip_limit', 'label' => 'IP下载限制', 'type' => 'number', 'default' => 0, 'min' => 0, 'help' => '同一IP每小时最大下载次数,0为不限制'],
]],
],