AI Implementation feature(894): Admin Area General Settings and Categories 1.12 (#34)
This commit was merged in pull request #34.
This commit is contained in:
@@ -78,7 +78,7 @@ export class AdminGeneralService {
|
||||
}
|
||||
|
||||
listThemes(): ThemeView[] {
|
||||
const themesDir = path.resolve(this.config.get<string>('THEMES_DIR', './themes'));
|
||||
const themesDir = this.resolveThemesDir(this.config.get<string>('THEMES_DIR', './themes'));
|
||||
let present = new Set<string>();
|
||||
try {
|
||||
if (fs.existsSync(themesDir)) {
|
||||
@@ -101,4 +101,10 @@ export class AdminGeneralService {
|
||||
.filter((t) => present.has(t.id))
|
||||
.map((t) => ({ id: t.id, key: t.id, name: t.name }));
|
||||
}
|
||||
|
||||
private resolveThemesDir(raw: string): string {
|
||||
if (path.isAbsolute(raw)) return raw;
|
||||
const backendRoot = path.resolve(__dirname, '..', '..', '..');
|
||||
return path.resolve(backendRoot, raw);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user