样式优化,markdown优化

This commit is contained in:
2025-08-22 17:14:38 +08:00
parent a1537e3f9f
commit b3d63e4181
11 changed files with 163 additions and 36 deletions

View File

@@ -45,6 +45,17 @@ export const useConversationStore = defineStore('conversation', {
this.messages.push({ role: 'system', content: notify, transient: true });
}
},
async createConversation(modelId: string, messages: any[] = [], title?: string) {
const auth = useAuthStore();
if (!auth.token) return null;
try {
const { data } = await axios.post('/api/conversations', { modelId, messages, title }, { headers: { Authorization: 'Bearer ' + auth.token } });
// prepend to list
this.list.unshift(data);
this.currentId = data._id;
return data;
} catch (e:any) { this.error = e.response?.data?.error || e.message; return null; }
},
pushMessage(m: ConversationMessage) { this.messages.push(m); },
patchLastAssistant(content: string) {
for (let i = this.messages.length - 1; i >=0; i--) {