feat: 首页开发
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user