Kaynağa Gözat

🐛 fix(chat): 修复消息时间戳类型转换问题

- 使用z.coerce.number()确保timestamp字段能正确转换字符串类型的时间戳为数字
yourname 6 ay önce
ebeveyn
işleme
2bfa1f2a4f

+ 1 - 1
src/server/modules/chat/chat-message.schema.ts

@@ -27,7 +27,7 @@ export const ChatMessageSchema = z.object({
     example: '张三',
     description: '发送者名称'
   }),
-  timestamp: z.number().int().positive().openapi({
+  timestamp: z.coerce.number().int().positive().openapi({
     example: 1704067200000,
     description: '消息时间戳'
   }),