24cd9cef53
- uni-app Vue3 frontend with dark glassmorphism theme - 5 AI dimensions: Origin / Development / Current / Learning / Trend - AI Chat system prompt updated from geometry to AI - 23 AI knowledge articles initialized in DB - Trend API + cron job for daily news - Product pricing (Pro ¥19.9, VIP ¥39.9) - Pinia stores + API utilities - AGENTS.md documentation
37 lines
1.0 KiB
JavaScript
Executable File
37 lines
1.0 KiB
JavaScript
Executable File
/**
|
|
* 快速修复BGM URL - 使用测试音频
|
|
*/
|
|
|
|
const mongoose = require('mongoose')
|
|
require('dotenv').config()
|
|
|
|
const { BGM } = require('../src/models')
|
|
|
|
// 免费的测试音频URL (SoundHelix - 可商用)
|
|
const TEST_AUDIO_URL = 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3'
|
|
|
|
async function fixBGMUrls() {
|
|
try {
|
|
await mongoose.connect(process.env.MONGODB_URI || 'mongodb://localhost:27017/yuzhiran')
|
|
console.log('✅ 数据库连接成功')
|
|
|
|
// 更新所有BGM的URL为测试音频
|
|
const result = await BGM.updateMany(
|
|
{},
|
|
{ url: TEST_AUDIO_URL }
|
|
)
|
|
|
|
console.log(`✅ 已更新 ${result.modifiedCount} 条BGM记录`)
|
|
console.log(` 新URL: ${TEST_AUDIO_URL}`)
|
|
console.log('\n💡 现在可以测试BGM播放功能了')
|
|
console.log('⚠️ 注意: 这是测试音频,生产环境请替换为正式音乐')
|
|
|
|
} catch (error) {
|
|
console.error('❌ 更新失败:', error)
|
|
} finally {
|
|
await mongoose.disconnect()
|
|
}
|
|
}
|
|
|
|
fixBGMUrls()
|