fenghuo/apps/backend/src/upload/utils.ts

5 lines
159 B
TypeScript
Raw Normal View History

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