Files
Henry_Du 4ce4649aaf
Build VoiceHub FPK / build-fpk (push) Failing after 56m5s
Build and Push Docker Image / build-and-push (push) Canceled after 1h9m35s
初次提交
2026-09-06 08:19:02 +08:00

37 lines
1.2 KiB
TypeScript

import { db } from './app/drizzle/db'
import { systemSettings } from './app/drizzle/schema'
import { CacheService } from './server/services/cacheService'
async function updateLogos() {
try {
// 检查是否存在系统设置
const existingSettings = await db.select().from(systemSettings).limit(1)
if (existingSettings.length > 0) {
await db.update(systemSettings).set({
siteLogoUrl: '/images/site-logo.png',
schoolLogoHomeUrl: '/images/school-logo-white.png',
schoolLogoPrintUrl: '/images/school-logo-transparent.png'
})
console.log('Successfully updated existing settings')
} else {
await db.insert(systemSettings).values({
siteLogoUrl: '/images/site-logo.png',
schoolLogoHomeUrl: '/images/school-logo-white.png',
schoolLogoPrintUrl: '/images/school-logo-transparent.png'
})
console.log('Successfully inserted new settings')
}
// 清理缓存
const cacheService = CacheService.getInstance()
await cacheService.clearSystemSettingsCache()
console.log('Successfully cleared cache')
} catch (error) {
console.error('Error updating logos:', error)
}
process.exit(0)
}
updateLogos()