From cab57e7f4d37dea83312c230ba1890e939ea7a75 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Tue, 11 Nov 2025 16:56:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=BC=BA=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E5=92=8C=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 `DebugComponent.vue` 中,添加用户登录信息、电话号码和头像的打印。 - 更新知识库信息的日志格式,增加基本信息、状态信息和查询参数的详细输出。 - 改进智能体配置信息的日志,增加智能体数量和可配置项的显示,并根据用户权限控制配置详情的可见性。 - 修改应用布局的头部背景颜色以提升视觉一致性。 --- web/src/components/DebugComponent.vue | 62 +++++++++++++++++++++------ web/src/layouts/AppLayout.vue | 2 +- 2 files changed, 49 insertions(+), 15 deletions(-) diff --git a/web/src/components/DebugComponent.vue b/web/src/components/DebugComponent.vue index 7dec3c48..32a3d364 100644 --- a/web/src/components/DebugComponent.vue +++ b/web/src/components/DebugComponent.vue @@ -352,6 +352,9 @@ const printUserInfo = () => { token: userStore.token ? '*** (已隐藏)' : null, userId: userStore.userId, username: userStore.username, + userIdLogin: userStore.userIdLogin, + phoneNumber: userStore.phoneNumber, + avatar: userStore.avatar, userRole: userStore.userRole, isLoggedIn: userStore.isLoggedIn, isAdmin: userStore.isAdmin, @@ -365,7 +368,28 @@ const printDatabaseInfo = async () => { if (!checkAdminPermission()) return; try { - console.log('知识库信息', databaseStore.database); + console.log('=== 知识库信息 ==='); + console.log('基本信息:', { + databaseId: databaseStore.databaseId, + databaseName: databaseStore.database.name, + databaseDesc: databaseStore.database.description, + fileCount: Object.keys(databaseStore.database.files || {}).length + }); + + console.log('状态信息:', { + databaseLoading: databaseStore.state.databaseLoading, + refrashing: databaseStore.state.refrashing, + searchLoading: databaseStore.state.searchLoading, + lock: databaseStore.state.lock, + autoRefresh: databaseStore.state.autoRefresh, + queryParamsLoading: databaseStore.state.queryParamsLoading + }); + + console.log('查询参数:', { + queryParams: databaseStore.queryParams, + meta: databaseStore.meta, + selectedFileCount: databaseStore.selectedRowKeys.length + }); } catch (error) { console.error('获取知识库信息失败:', error); @@ -386,22 +410,23 @@ const printAgentConfig = async () => { try { console.log('=== 智能体配置信息 ==='); - // 从store 获取状态信息 + // Store状态信息 console.log('Store 状态:', { isInitialized: agentStore.isInitialized, selectedAgentId: agentStore.selectedAgentId, defaultAgentId: agentStore.defaultAgentId, + agentCount: agentStore.agentsList.length, loadingStates: { isLoadingAgents: agentStore.isLoadingAgents, isLoadingConfig: agentStore.isLoadingConfig, isLoadingTools: agentStore.isLoadingTools }, error: agentStore.error, - note: '线程相关状态已迁移到组件级别' + hasConfigChanges: agentStore.hasConfigChanges }); // 智能体列表信息 - console.log('智能体列表 (从store):', { + console.log('智能体列表:', { count: agentStore.agentsList.length, agents: toRaw(agentStore.agentsList) }); @@ -411,22 +436,31 @@ const printAgentConfig = async () => { console.log('当前选中智能体:', { agent: toRaw(agentStore.selectedAgent), isDefault: agentStore.isDefaultAgent, - configurableItems: Object.keys(agentStore.configurableItems).length + configurableItemsCount: Object.keys(agentStore.configurableItems).length }); - // 当前智能体配置 - console.log('当前智能体配置:', { - current: toRaw(agentStore.agentConfig), - original: toRaw(agentStore.originalAgentConfig), - hasChanges: agentStore.hasConfigChanges - }); + // 当前智能体配置(仅管理员可见) + if (userStore.isAdmin) { + console.log('当前智能体配置:', { + current: toRaw(agentStore.agentConfig), + original: toRaw(agentStore.originalAgentConfig), + hasChanges: agentStore.hasConfigChanges + }); + } else { + console.log('智能体配置: 需要管理员权限查看详细配置'); + } } // 工具信息 - console.log('可用工具:', toRaw(agentStore.availableTools)); + console.log('可用工具:', { + count: agentStore.availableTools.length, + tools: toRaw(agentStore.availableTools) + }); - // 注意:线程和对话相关信息已迁移到AgentChatComponent组件级别 - console.log('注意: 线程和对话状态已迁移到组件级别,请在AgentChatComponent中查看相关信息'); + // 配置项信息(管理员可见) + if (userStore.isAdmin && agentStore.selectedAgent) { + console.log('可配置项:', toRaw(agentStore.configurableItems)); + } } catch (error) { console.error('获取智能体配置失败:', error); diff --git a/web/src/layouts/AppLayout.vue b/web/src/layouts/AppLayout.vue index 628529c8..22358cf2 100644 --- a/web/src/layouts/AppLayout.vue +++ b/web/src/layouts/AppLayout.vue @@ -284,7 +284,7 @@ div.header, #app-router-view { flex: 0 0 @header-width; justify-content: flex-start; align-items: center; - background-color: var(--main-10); + background-color: var(--main-0); height: 100%; width: @header-width; border-right: 1px solid var(--gray-100);