feat: 破坏file/db相关接口

This commit is contained in:
手瓜一十雪
2024-07-22 14:09:37 +08:00
parent 087c76b394
commit 72d2d3f224
9 changed files with 142 additions and 148 deletions

View File

@@ -474,4 +474,4 @@ class DBUtil extends DBUtilBase {
}
export const dbUtil = new DBUtil();
// export const dbUtil = new DBUtil();

View File

@@ -4,7 +4,6 @@ import crypto from 'crypto';
import util from 'util';
import path from 'node:path';
import { log, logError } from './log';
import { dbUtil } from '@/common/utils/db';
import * as fileType from 'file-type';
import { v4 as uuidv4 } from 'uuid';
import { napCatCore } from '@/core';
@@ -251,13 +250,14 @@ export async function uri2local(uri: string, fileName: string | null = null): Pr
} else {
filePath = pathname;
}
} else {
const cache = await dbUtil.getFileCacheByName(uri);
if (cache) {
filePath = cache.path;
} else {
filePath = uri;
}
}
else {
// const cache = await dbUtil.getFileCacheByName(uri);
// if (cache) {
// filePath = cache.path;
// } else {
// filePath = uri;
// }
}
res.isLocal = true;