fix: createMessage 字段名改为 senderType/contentType 匹配后端 DTO

This commit is contained in:
2026-06-29 23:36:26 +08:00
parent f45fee7cce
commit 3829a3ef92
+8 -9
View File
@@ -709,8 +709,8 @@ const initializeFirstAIMessage = async () => {
await createMessage({ await createMessage({
conversationId: conversationId.value, conversationId: conversationId.value,
content: theme, content: theme,
sender: 'user', senderType: 'user',
type: 'chat' contentType: 'chat'
}) })
} }
@@ -718,9 +718,8 @@ const initializeFirstAIMessage = async () => {
await createMessage({ await createMessage({
conversationId: conversationId.value, conversationId: conversationId.value,
content, content,
sender: 'assistant', senderType: 'assistant',
type: 'script', contentType: 'script',
metadata: JSON.stringify(currentResult.value?.plotJson || {}),
versionNumber: 1 versionNumber: 1
}) })
} catch (error) { } catch (error) {
@@ -798,8 +797,8 @@ const sendChat = async () => {
const userMessageRes = await createMessage({ const userMessageRes = await createMessage({
conversationId: conversationId.value, conversationId: conversationId.value,
content, content,
sender: 'user', senderType: 'user',
type: 'chat' contentType: 'chat'
}) })
const userMessageId = userMessageRes.data?.id const userMessageId = userMessageRes.data?.id
@@ -849,8 +848,8 @@ const sendRewrite = async (targetMessageId, content) => {
const userMessageRes = await createMessage({ const userMessageRes = await createMessage({
conversationId: conversationId.value, conversationId: conversationId.value,
content, content,
sender: 'user', senderType: 'user',
type: 'chat' contentType: 'chat'
}) })
const userMessageId = userMessageRes.data?.id const userMessageId = userMessageRes.data?.id