core: oplog: better logging

This commit is contained in:
undefined committed 2021-12-21 21:34:49 +08:00
1 parent 92c1a41585
commit ead0d54a55
8 files changed
+74 -60

No files matched your search

+1 -7
View File
@@ -91,14 +91,8 @@ export class FSDownloadHandler extends Handler {
this.response.addHeader('Cache-Control', 'public');
const target = `user/${uid}/${filename}`;
const file = await storage.getMeta(target);
await oplog.add({
type: 'download',
time: new Date(),
uid: this.user._id,
ip: this.request.ip,
fileType: 'user',
await oplog.log(this, 'download.file.user', {
target,
referer: this.request.referer,
size: file?.size || 0,
});
if (!file) {