feat: 支持配置系统图标

This commit is contained in:
Nixevol
2026-07-05 00:27:44 +08:00
parent c56ca91edd
commit accc8a7d6f
20 changed files with 182 additions and 36 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ export class SettingsController {
@ApiOperation({ summary: '获取公开设置(应用名等)' })
async getPublic() {
const all = await this.settingsService.getAll();
return { appName: all.appName, carouselInterval: all.carouselInterval, filingInfo: all.filingInfo };
return { appName: all.appName, appIconUrl: all.appIconUrl, carouselInterval: all.carouselInterval, filingInfo: all.filingInfo };
}
@ApiBearerAuth()
@@ -4,6 +4,7 @@ import { PrismaService } from '../prisma/prisma.service';
const EDITABLE_KEYS = [
'appName',
'appIconUrl',
'logRetentionDays',
'operationLogRetentionDays',
'watermarkText',
@@ -26,6 +27,7 @@ export class SettingsService {
const rows = await this.prisma.systemSetting.findMany();
const map: Record<string, string> = {
appName: this.config.get<string>('appName') || '',
appIconUrl: '/app-icon.svg',
logRetentionDays: String(this.config.get<number>('logRetentionDays') || 365),
operationLogRetentionDays: '365',
watermarkText: this.config.get<string>('watermarkText') || '仅供溯源核验使用',
@@ -39,6 +41,7 @@ export class SettingsService {
for (const r of rows) {
map[r.key] = r.key === 'appName' && r.value === '艺术品可信溯源与认证平台' ? '艺术品溯源平台' : r.value;
}
if (!map.appIconUrl) map.appIconUrl = '/app-icon.svg';
return map;
}