fix(desktop): console.log 清理 — 替换为结构化 logger
将 desktop/src 中 23 处 console.log 替换为 createLogger() 结构化日志: - 生产构建自动静默 debug/info 级别 - 保留 console.error 用于关键错误可见性 - 新增 dompurify 依赖修复 XSS 防护引入缺失 涉及文件: App.tsx, offlineStore.ts, autonomy-manager.ts, gateway-auth.ts, llm-service.ts, request-helper.ts, security-index.ts, skill-discovery.ts, use-onboarding.ts 等 16 个文件
This commit is contained in:
@@ -27,6 +27,9 @@ import { ScenarioTags } from './ScenarioTags';
|
||||
import type { Clone } from '../store/agentStore';
|
||||
import { intelligenceClient } from '../lib/intelligence-client';
|
||||
import { generateSoulContent, generateUserContent } from '../lib/personality-presets';
|
||||
import { createLogger } from '../lib/logger';
|
||||
|
||||
const log = createLogger('AgentOnboardingWizard');
|
||||
|
||||
// === Types ===
|
||||
|
||||
@@ -215,9 +218,9 @@ export function AgentOnboardingWizard({ isOpen, onClose, onSuccess }: AgentOnboa
|
||||
// Write USER.md (user profile)
|
||||
await intelligenceClient.identity.updateFile(clone.id, 'user_profile', userContent);
|
||||
|
||||
console.log('[Onboarding] SOUL.md and USER.md persisted for agent:', clone.id);
|
||||
log.debug('SOUL.md and USER.md persisted for agent:', clone.id);
|
||||
} catch (err) {
|
||||
console.warn('[Onboarding] Failed to persist identity files:', err);
|
||||
log.warn('Failed to persist identity files:', err);
|
||||
// Don't fail the whole onboarding if identity persistence fails
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
} from 'lucide-react';
|
||||
import { PipelineRunResponse } from '../lib/pipeline-client';
|
||||
import { useToast } from './ui/Toast';
|
||||
import DOMPurify from 'dompurify';
|
||||
import { ClassroomPreviewer, type ClassroomData } from './ClassroomPreviewer';
|
||||
|
||||
// === Types ===
|
||||
|
||||
Reference in New Issue
Block a user