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