fix(captcha): 1:1 align bind-phone and real status contracts
Add bind_phone captcha scene across schema/runtime/UI, require captcha on phone bind, return real captcha status objects instead of legacy option aliases, and harden form discovery for page-sign auth forms.
This commit is contained in:
@@ -154,32 +154,38 @@ onMounted(async () => {
|
||||
const d = res.data
|
||||
const svc = res.services || {}
|
||||
|
||||
const captcha = d.captcha || svc.captcha || {}
|
||||
const captchaOn = !!(captcha.enabled && captcha.configured)
|
||||
const captchaScenes = captcha.scenes || {}
|
||||
const audit = d.content_audit || svc.audit || {}
|
||||
const ipGeo = d.ip_geo || svc.ip_geo || {}
|
||||
|
||||
securityItems.value[0].value = d.email_gate_enabled ? '已开启' : '未开启'
|
||||
securityItems.value[0].color = d.email_gate_enabled ? '#52c41a' : '#8a909c'
|
||||
securityItems.value[1].value = d.captcha_enabled ? '已开启' : '未开启'
|
||||
securityItems.value[1].color = d.captcha_enabled ? '#52c41a' : '#8a909c'
|
||||
securityItems.value[1].value = captchaOn ? '已开启' : '未开启'
|
||||
securityItems.value[1].color = captchaOn ? '#52c41a' : '#8a909c'
|
||||
|
||||
if (svc.audit?.enabled) {
|
||||
securityItems.value[2].value = svc.audit.configured ? '已配置' : '待补全'
|
||||
securityItems.value[2].color = svc.audit.configured ? '#52c41a' : '#faad14'
|
||||
if (audit.enabled) {
|
||||
securityItems.value[2].value = audit.configured ? '已配置' : '待补全'
|
||||
securityItems.value[2].color = audit.configured ? '#52c41a' : '#faad14'
|
||||
} else {
|
||||
securityItems.value[2].value = '未开启'
|
||||
securityItems.value[2].color = '#8a909c'
|
||||
}
|
||||
|
||||
if (svc.ip_geo?.enabled) {
|
||||
securityItems.value[3].value = svc.ip_geo.configured ? '已配置' : '待补全'
|
||||
securityItems.value[3].color = svc.ip_geo.configured ? '#52c41a' : '#faad14'
|
||||
if (ipGeo.enabled) {
|
||||
securityItems.value[3].value = ipGeo.configured ? '已配置' : '待补全'
|
||||
securityItems.value[3].color = ipGeo.configured ? '#52c41a' : '#faad14'
|
||||
} else {
|
||||
securityItems.value[3].value = '未开启'
|
||||
securityItems.value[3].color = '#8a909c'
|
||||
}
|
||||
|
||||
features.value[0].enabled = !!d.email_gate_enabled
|
||||
features.value[1].enabled = !!d.captcha_comment_enabled
|
||||
features.value[2].enabled = !!d.captcha_download_enabled
|
||||
features.value[3].enabled = !!(svc.audit?.enabled ?? d.content_audit_enabled)
|
||||
features.value[4].enabled = !!(svc.ip_geo?.enabled ?? d.ip_geo_enabled)
|
||||
features.value[1].enabled = !!captchaScenes.comment
|
||||
features.value[2].enabled = !!captcha.download_active
|
||||
features.value[3].enabled = !!audit.enabled
|
||||
features.value[4].enabled = !!ipGeo.enabled
|
||||
|
||||
if (d.risk_switches) {
|
||||
riskSwitches.value = { ...riskSwitches.value, ...d.risk_switches }
|
||||
|
||||
@@ -136,8 +136,8 @@ onMounted(async () => {
|
||||
services.value[0].status = svc.sms?.provider || (s.sms_enabled ? '已启用' : '未配置')
|
||||
services.value[1].available = !!(svc.wechat?.available ?? s.wechat_enabled)
|
||||
services.value[1].status = svc.wechat?.provider || (s.wechat_enabled ? '已启用' : '未配置')
|
||||
services.value[2].available = !!(svc.captcha?.available ?? s.captcha_enabled)
|
||||
services.value[2].status = svc.captcha?.provider || (s.captcha_enabled ? '已启用' : '未配置')
|
||||
services.value[2].available = !!(svc.captcha?.available ?? svc.captcha?.configured)
|
||||
services.value[2].status = svc.captcha?.provider || (svc.captcha?.enabled ? '已启用' : '未配置')
|
||||
services.value[3].available = !!(svc.push?.available ?? s.baidu_push_enabled)
|
||||
services.value[3].status = svc.push?.provider || (s.baidu_push_enabled ? '已启用' : '未配置')
|
||||
services.value[4].available = !!(svc.audit?.available ?? s.content_audit_enabled)
|
||||
|
||||
@@ -64,6 +64,7 @@ export const permissionsSchemas = {
|
||||
{ label: '用户登录', value: 'login' },
|
||||
{ label: '用户注册', value: 'register' },
|
||||
{ label: '绑定第三方', value: 'bind' },
|
||||
{ label: '绑定手机', value: 'bind_phone' },
|
||||
{ label: '找回密码', value: 'lostpassword' },
|
||||
{ label: '修改密码', value: 'change_password' },
|
||||
{ label: '更改邮箱', value: 'change_email' },
|
||||
|
||||
Reference in New Issue
Block a user