feat: add smoke tests, agent credit ledger, and player cashback page

Introduce admin smoke-test suite with API probes, agent credit transaction history, and player cashback records; fix SmokeTestModule DI and polish admin/player UI assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-09 16:05:48 +08:00
parent 9c6c5e51f3
commit d5e7c8edb3
52 changed files with 3357 additions and 67 deletions

View File

@@ -0,0 +1,16 @@
import { existsSync } from 'fs';
import { resolve } from 'path';
export function getUploadRoot() {
if (process.env.UPLOAD_DIR?.trim()) {
return resolve(process.env.UPLOAD_DIR.trim());
}
const candidates = [
resolve(process.cwd(), '..', '..', 'uploads'),
resolve(process.cwd(), 'uploads'),
resolve(__dirname, '..', '..', 'uploads'),
];
return candidates.find((p) => existsSync(p)) ?? candidates[0];
}