feat: 首页开发

This commit is contained in:
2026-04-12 09:55:14 +08:00
parent fb3b072975
commit a2a3bd2bee
3 changed files with 249 additions and 386 deletions

View File

@@ -214,10 +214,10 @@ async function send() {
const text = inputText.value.trim();
if (!text || isSending.value) return;
// 首次发送时创建会话
// 首次发送时创建会话,使用用户输入的第一条消息作为 title
if (!currentSessionId.value) {
try {
const session = await window.opencode.createSession();
const session = await window.opencode.createSession({ title: text });
currentSessionId.value = session.id;
} catch (err) {
ElMessage.error(`创建会话失败: ${err.message}`);