rht
This commit is contained in:
parent
55e5412f5e
commit
946969b503
|
@ -111,7 +111,7 @@ export class ShareCodeService extends BaseService<Prisma.ShareCodeDelegate> {
|
|||
let existingShareCode;
|
||||
do {
|
||||
// 查找是否已有相同 shareCode 或者相同 FileID 的分享码记录
|
||||
existingShareCode = await super.findUnique({
|
||||
existingShareCode = await super.findFirst({
|
||||
where: {
|
||||
OR: [
|
||||
{ code },
|
||||
|
@ -120,6 +120,9 @@ export class ShareCodeService extends BaseService<Prisma.ShareCodeDelegate> {
|
|||
},
|
||||
});
|
||||
// 如果找到的是已经被删除的码,则可以使用并更新其他信息,否则重新生成
|
||||
if(!existingShareCode){
|
||||
break
|
||||
}
|
||||
if (existingShareCode.deleteAt !== null) {
|
||||
break
|
||||
}
|
||||
|
@ -141,7 +144,7 @@ export class ShareCodeService extends BaseService<Prisma.ShareCodeDelegate> {
|
|||
fileName: filename || "downloaded_file",
|
||||
uploadIp,
|
||||
createdAt: new Date(),
|
||||
deleteAt: null
|
||||
deletedAt: null
|
||||
},
|
||||
});
|
||||
} else {
|
||||
|
@ -403,7 +406,7 @@ export class ShareCodeService extends BaseService<Prisma.ShareCodeDelegate> {
|
|||
},
|
||||
select: { ...ShareCodeSelect }
|
||||
});
|
||||
const {totalSize, resourceCount} = this.calculateTotalSize(shareCodes);
|
||||
const {totalSize, resourceCount} = this.calculateTotalSize(shareCodes as any as GenerateShareCodeResponse[]);
|
||||
|
||||
this.logger.log(`资源总大小: ${totalSize}, 资源数量: ${resourceCount}`);
|
||||
return { totalSize, resourceCount };
|
||||
|
@ -446,7 +449,7 @@ export class ShareCodeService extends BaseService<Prisma.ShareCodeDelegate> {
|
|||
...ShareCodeSelect
|
||||
}
|
||||
});
|
||||
const {totalSize, resourceCount} = this.calculateTotalSize(shareCodes);
|
||||
const {totalSize, resourceCount} = this.calculateTotalSize(shareCodes as any as GenerateShareCodeResponse[]);
|
||||
this.logger.log(`${dateType}资源总大小: ${totalSize}, 资源数量: ${resourceCount}`);
|
||||
return { totalSize, resourceCount };
|
||||
} catch (error) {
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
"framer-motion": "^11.15.0",
|
||||
"hls.js": "^1.5.18",
|
||||
"idb-keyval": "^6.2.1",
|
||||
"mind-elixir": "workspace:^",
|
||||
"mitt": "^3.0.1",
|
||||
"quill": "2.0.3",
|
||||
"react": "18.2.0",
|
||||
|
|
1555
pnpm-lock.yaml
1555
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue