Fixed the issue of inconsistent date creation, if the running server and the database are in different regions, the generated date will be inconsistent, and the generated date will be inconsistent

This commit is contained in:
Joe
2024-03-09 18:39:56 +08:00
parent 6eab5cf681
commit d98ac8236a
+2
View File
@@ -1652,6 +1652,8 @@ export class App {
const newChatMessage = new ChatMessage()
Object.assign(newChatMessage, chatMessage)
if (!newChatMessage.createdDate) newChatMessage.createdDate = new Date()
const chatmessage = this.AppDataSource.getRepository(ChatMessage).create(newChatMessage)
return await this.AppDataSource.getRepository(ChatMessage).save(chatmessage)
}