Fix: 修复依赖相关问题

This commit is contained in:
2025-08-08 17:42:41 +08:00
parent 18548ef9fb
commit 86a59aff1f
4 changed files with 787 additions and 693 deletions

View File

@ -18,10 +18,10 @@ ipcMain.on('play-sound', (_, soundFile) => {
// 判断是开发环境还是生产环境
if (process.env.NODE_ENV === 'development') {
// 开发环境下,路径指向 src
soundPath = path.join(__dirname, '../renderer/src/assets/sounds', soundFile);
// 开发模式下,直接指向 renderer/public 里的文件
soundPath = path.join(__dirname, '../renderer/public/assets/sounds', soundFile);
} else {
// 生产环境下,路径指向打包后的 dist 目录
// 生产模式下Vite 会把 public 里的文件复制到 dist 文件夹
soundPath = path.join(__dirname, '../renderer/dist/assets/sounds', soundFile);
}