From 666b7e51c51d5aa7de609f7d561e0bd3df8c11f3 Mon Sep 17 00:00:00 2001 From: xichaoyin Date: Tue, 9 Jan 2024 22:23:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:fightlog=E6=B7=BB=E5=8A=A0ttl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/module/collection_fightLog.ts | 2 +- src/public/fight.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module/collection_fightLog.ts b/src/module/collection_fightLog.ts index a0bc0d5..58f84d9 100644 --- a/src/module/collection_fightLog.ts +++ b/src/module/collection_fightLog.ts @@ -1,4 +1,4 @@ import {fightResult} from '../shared/fightControl/fightType'; -export type CollectionFightLog = fightResult & { uid: string, type: string }; \ No newline at end of file +export type CollectionFightLog = fightResult & { uid: string, type: string, ttl: Date}; \ No newline at end of file diff --git a/src/public/fight.ts b/src/public/fight.ts index 22abc1b..2b211b9 100644 --- a/src/public/fight.ts +++ b/src/public/fight.ts @@ -137,7 +137,7 @@ export class FightFun { let writeList = ['ganhai', 'jjc', 'hbzbJfs', 'hbzbZbs', 'slzd', 'clsl'] if (uid.indexOf('npc') != -1 || !writeList.includes(type)) return; - G.mongodb.collection('fightLog').insertOne({ uid, type, ...result }) + G.mongodb.collection('fightLog').insertOne({ uid, type, ...result, ttl: new Date() }) }