collect-system/apps/server/src/upload/utils.ts

4 lines
158 B
TypeScript
Raw Normal View History

2025-01-08 00:52:11 +08:00
export function extractFileIdFromNginxUrl(url: string) {
const match = url.match(/uploads\/(\d{4}\/\d{2}\/\d{2}\/[^/]+)/);
return match ? match[1] : '';
}