web端打通oss资源上传

This commit is contained in:
2026-07-01 21:46:36 +08:00
parent ef6cc18fb2
commit 139e37651b
22 changed files with 1186 additions and 40 deletions
@@ -0,0 +1,7 @@
import { randomUUID } from 'crypto';
export function buildOssObjectKey(uploadPrefix: string, bizType: string, fileName: string): string {
const ext = fileName.includes('.') ? fileName.split('.').pop() : 'bin';
const dir = `${uploadPrefix.replace(/\/$/, '')}/${bizType.toLowerCase()}/`;
return `${dir}${Date.now()}-${randomUUID().slice(0, 8)}.${ext}`;
}