新增: 跨端图片上传(file.1216.top URL 优先,失败回退 base64,协议对齐)

This commit is contained in:
lxy
2026-08-08 14:19:26 +08:00
parent 4ce6a859e7
commit d19784a414
9 changed files with 247 additions and 42 deletions
@@ -988,10 +988,16 @@ function send(text: string, skill?: string | null, spans?: MentionSpan[] | null,
maxRoundsActive.value = false // P1-E:新 generation 清 MaxRounds 挂起
// 本地先 push user 气泡(乐观渲染,对齐桌面 sendMessage)
// images:从 parts 提取图片展示(优先 url,回退 base64 dataURL),避免 content 空时空白气泡。
const userImages = (parts || [])
.filter((p) => p.type === 'image')
.map((p) => (p.type === 'image' ? (p.url || (p.base64 ? `data:${p.media_type};base64,${p.base64}` : '')) : ''))
.filter((s) => !!s)
messages.value.push({
id: genId('user'),
role: 'user',
content: trimmed,
...(userImages.length ? { images: userImages } : {}),
timestamp: Date.now(),
}); triggerRef(messages)