feat: 支持后台配置备案信息
This commit is contained in:
@@ -62,6 +62,7 @@ async function ensureSettings(): Promise<void> {
|
||||
appName: process.env.APP_NAME || '艺术品溯源平台',
|
||||
logRetentionDays: process.env.LOG_RETENTION_DAYS || '365',
|
||||
watermarkText,
|
||||
filingInfo: '备案信息待补充',
|
||||
};
|
||||
for (const [key, value] of Object.entries(defaults)) {
|
||||
await prisma.systemSetting.upsert({ where: { key }, update: {}, create: { key, value } });
|
||||
|
||||
@@ -22,7 +22,7 @@ export class SettingsController {
|
||||
@ApiOperation({ summary: '获取公开设置(应用名等)' })
|
||||
async getPublic() {
|
||||
const all = await this.settingsService.getAll();
|
||||
return { appName: all.appName, carouselInterval: all.carouselInterval };
|
||||
return { appName: all.appName, carouselInterval: all.carouselInterval, filingInfo: all.filingInfo };
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
|
||||
@@ -7,6 +7,7 @@ const EDITABLE_KEYS = [
|
||||
'logRetentionDays',
|
||||
'operationLogRetentionDays',
|
||||
'watermarkText',
|
||||
'filingInfo',
|
||||
'carouselInterval',
|
||||
'backupEnabled',
|
||||
'backupSchedule',
|
||||
@@ -28,6 +29,7 @@ export class SettingsService {
|
||||
logRetentionDays: String(this.config.get<number>('logRetentionDays') || 365),
|
||||
operationLogRetentionDays: '365',
|
||||
watermarkText: this.config.get<string>('watermarkText') || '仅供溯源核验使用',
|
||||
filingInfo: '备案信息待补充',
|
||||
carouselInterval: '3',
|
||||
backupEnabled: 'false',
|
||||
backupSchedule: 'daily',
|
||||
|
||||
Reference in New Issue
Block a user