fix:返回消息的时间戳错误问题
This commit is contained in:
@@ -15,7 +15,8 @@ export const ChatSendResponseSchema = z.object({
|
||||
currentMood: z.string().default(""),
|
||||
messageId: z.string(),
|
||||
isGuest: z.boolean().default(false),
|
||||
timestamp: z.number().default(0),
|
||||
// 函数式 default —— 每次 parse 时**重新**调 Date.now()(后端不返回 timestamp 时用**当下**时间)
|
||||
timestamp: z.number().default(() => Date.now()),
|
||||
});
|
||||
|
||||
export type ChatSendResponseInput = z.input<typeof ChatSendResponseSchema>;
|
||||
|
||||
@@ -68,6 +68,7 @@ export const sendMessageHttpActor = fromPromise<
|
||||
messageId: result.data.messageId,
|
||||
timestamp: result.data.timestamp,
|
||||
});
|
||||
|
||||
const reply = sendResponseToUiMessage(result.data);
|
||||
console.log("[chat-machine] sendMessageHttpActor done", {
|
||||
replyContentLength: reply.content.length,
|
||||
|
||||
Reference in New Issue
Block a user