feat: 完善后台导入日志权限与备份恢复
This commit is contained in:
@@ -2,7 +2,17 @@ import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
|
||||
const EDITABLE_KEYS = ['appName', 'logRetentionDays', 'watermarkText', 'carouselInterval'];
|
||||
const EDITABLE_KEYS = [
|
||||
'appName',
|
||||
'logRetentionDays',
|
||||
'operationLogRetentionDays',
|
||||
'watermarkText',
|
||||
'carouselInterval',
|
||||
'backupEnabled',
|
||||
'backupSchedule',
|
||||
'backupRetentionDays',
|
||||
'backupRetentionCount',
|
||||
];
|
||||
|
||||
@Injectable()
|
||||
export class SettingsService {
|
||||
@@ -16,9 +26,13 @@ export class SettingsService {
|
||||
const map: Record<string, string> = {
|
||||
appName: this.config.get<string>('appName') || '',
|
||||
logRetentionDays: String(this.config.get<number>('logRetentionDays') || 365),
|
||||
operationLogRetentionDays: '365',
|
||||
watermarkText: this.config.get<string>('watermarkText') || '仅供溯源核验使用',
|
||||
// C 端顶部媒体轮播:单张停留秒数(支持小数),0 表示不自动切换
|
||||
carouselInterval: '3',
|
||||
backupEnabled: 'false',
|
||||
backupSchedule: 'daily',
|
||||
backupRetentionDays: '30',
|
||||
backupRetentionCount: '10',
|
||||
};
|
||||
for (const r of rows) map[r.key] = r.value;
|
||||
return map;
|
||||
|
||||
Reference in New Issue
Block a user