feat: 新增背景音乐功能

This commit is contained in:
Zhukj
2025-12-12 17:49:20 +08:00
parent 717d263850
commit bc8b63d231
8 changed files with 81 additions and 3 deletions

View File

@@ -76,7 +76,17 @@ app.post('/api/config', (req, res) => {
res.status(500).json({ error: '保存配置文件失败' });
}
});
// 第78行新增位置
// API: 获取音乐配置
app.get('/api/musicConfig', (req, res) => {
try {
const configData = fs.readFileSync(CONFIG_FILE_PATH, 'utf8');
const config = JSON.parse(configData);
res.json(config.musicConfig || { enabled: false });
} catch (error) {
res.status(500).json({ enabled: false });
}
});
// API: 上传图片
app.post('/api/upload', upload.single('image'), (req, res) => {
try {