test/user-journey #3

Merged
zhangxiang merged 142 commits from test/user-journey into dev 2026-04-12 13:17:03 +08:00
Showing only changes of commit 1777dd1606 - Show all commits
+6 -2
View File
@@ -3,6 +3,10 @@ import { existsSync } from 'fs';
import path from 'path';
import { nanoid } from 'nanoid';
function getWorkingDirectory(): string {
return process.cwd();
}
export interface UploadOptions {
maxSize?: number;
allowedTypes?: string[];
@@ -130,7 +134,7 @@ export async function uploadFile(
const uploadBaseDir = process.env.UPLOAD_DIR || './uploads';
const datePath = getDatePath();
const uploadDir = path.join(process.cwd(), uploadBaseDir, type, datePath);
const uploadDir = path.join(getWorkingDirectory(), uploadBaseDir, type, datePath);
if (!existsSync(uploadDir)) {
await mkdir(uploadDir, { recursive: true });
@@ -184,7 +188,7 @@ export async function getFileInfo(filePath: string) {
createdAt: stats.birthtime,
modifiedAt: stats.mtime,
};
} catch (error) {
} catch {
return null;
}
}