🐾 福州圣恩宠物医院

管理后台

还没有账号?立即注册

⚠️ 注意:验证邮箱为 757248993@qq.com

已有账号?返回登录

添加账号

添加服务

添加医生

// ========== 内容审核功能 ========== function refreshModerationLogs() { const logs = Security.getLogs().filter(log => log.action.includes('CONTENT') || log.action.includes('UPLOAD_REJECTED') || log.action.includes('IMAGE') || log.action.includes('VIDEO') ); const container = document.getElementById('moderationLogsContent'); if (!container) return; if (logs.length === 0) { container.innerHTML = '
暂无审核记录
'; return; } container.innerHTML = logs.map(log => `
${log.action} ${new Date(log.timestamp).toLocaleString()}
${log.details.keywords ? '敏感词: ' + log.details.keywords.join(', ') : ''} ${log.details.fileName ? '文件: ' + log.details.fileName : ''} ${log.details.reason ? '原因: ' + log.details.reason : ''}
`).join(''); } function testContentModeration() { const testTexts = [ { text: '这是一条正常内容', expect: 'safe' }, { text: '这是一个色情网站', expect: 'warn' }, { text: '色情片黄色内容成人电影', expect: 'reject' } ]; let results = ''; testTexts.forEach(t => { const result = ContentModeration.audit(t.text); results += '测试: "' + t.text + '"\n结果: ' + result.riskLevel + ' - ' + (result.passed ? '通过' : '拦截') + '\n\n'; }); alert(results); } function clearModerationLogs() { if (confirm('确定要清除所有审核日志吗?')) { const logs = Security.getLogs().filter(log => !log.action.includes('CONTENT') && !log.action.includes('UPLOAD_REJECTED') && !log.action.includes('IMAGE_REJECTED') && !log.action.includes('VIDEO_REJECTED') ); localStorage.setItem(Security.logKey, JSON.stringify(logs)); refreshModerationLogs(); showToast('审核日志已清除', 'success'); } } // 文件上传审核 function moderateFileUpload(file, type) { let result; if (type === 'image') { result = ContentModeration.auditImage(file); } else if (type === 'video') { result = ContentModeration.auditVideo(file); } else { result = { passed: true }; } if (!result.passed) { showToast(result.message, 'error'); return false; } return true; }