后台:内存快照
This commit is contained in:
@@ -135,4 +135,23 @@ export async function saveRebirthLog(session: any, hero: HeroType) {
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveMemoryLog(sid: string, memoryLogField: string, memoryData: string) {
|
||||
try {
|
||||
await UserLogModel.createRecord({ type: LOG_TYPE.MEMORY, sid, memoryLogField, memoryData });
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveMemoryLogs(sid: string, arr: { memoryLogField: string, memoryData: string} []) {
|
||||
try {
|
||||
let params = arr.map(({ memoryLogField, memoryData }) => {
|
||||
return { type: LOG_TYPE.MEMORY, sid, memoryLogField, memoryData }
|
||||
})
|
||||
await UserLogModel.createRecords(params);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user