diff --git a/README.md b/README.md index a4365676..3a081da1 100644 --- a/README.md +++ b/README.md @@ -62,10 +62,9 @@ | 人格体 | 角色 | 职责 | |--------|------|------| -| **铸渊 Zhùyuān** | 代码守护者 | 代码审查、CI 巡检、模块协议执行、Issue 回复 | +| **铸渊 Zhùyuān** | 代码守护者 | 代码审查、CI 巡检、模块协议执行、Issue 回复、对话协助、代码生成、开发体验([Persona Studio](https://qinfendebingshuo.github.io/guanghulab/persona-studio/)) | | **冰朔 Bīng Shuò** | 系统创建者 | 系统架构设计、核心决策、广播发布 | | **霜砚 Shuāng Yàn** | 人格导师 | 人格调校、风格管理、联觉语言系统 | -| **铸渊 Zhùyuān** | 代码守护者 | 代码审查、CI 巡检、模块协议执行、Issue 回复、对话协助、代码生成、开发体验([Persona Studio](https://qinfendebingshuo.github.io/guanghulab/persona-studio/)) | --- diff --git a/persona-studio/frontend/chat.html b/persona-studio/frontend/chat.html index e5d81689..38a10165 100644 --- a/persona-studio/frontend/chat.html +++ b/persona-studio/frontend/chat.html @@ -82,11 +82,11 @@
diff --git a/persona-studio/frontend/chat.js b/persona-studio/frontend/chat.js index a3c0f409..e3a50cce 100644 --- a/persona-studio/frontend/chat.js +++ b/persona-studio/frontend/chat.js @@ -22,6 +22,7 @@ const API_BASE = (function () { let conversationHistory = []; let buildReady = false; let pendingFile = null; // { name, type, dataUrl } +const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB const isGuest = (DEV_ID === 'GUEST'); const isDeveloper = (DEV_ID && DEV_ID !== 'GUEST' && /^EXP-\d{3,}$/.test(DEV_ID)); @@ -48,7 +49,7 @@ function setActiveSessionId(id) { } function createNewSession() { - var id = Date.now().toString(36) + Math.random().toString(36).slice(2, 6); + var id = Date.now().toString(36) + Math.random().toString(36).slice(2, 10); var session = { id: id, title: '新对话', @@ -299,8 +300,7 @@ function handleFileSelect(event, type) { var file = event.target.files[0]; if (!file) return; - var maxSize = 5 * 1024 * 1024; // 5MB - if (file.size > maxSize) { + if (file.size > MAX_FILE_SIZE) { appendMessage('system', '⚠️ 文件过大,最大支持 5MB'); event.target.value = ''; return; @@ -318,11 +318,7 @@ function handleFileSelect(event, type) { showUploadPreview(); }; - if (type === 'image') { - reader.readAsDataURL(file); - } else { - reader.readAsDataURL(file); - } + reader.readAsDataURL(file); event.target.value = ''; }