feat:确保仅在 Electron 中调用 API 发送歌曲数据

This commit is contained in:
alger
2025-04-12 13:05:08 +08:00
parent 09f8837fe4
commit b9b52f4d9f
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -116,7 +116,9 @@ onMounted(async () => {
// 使用 nextTick 确保 DOM 更新后再初始化
await nextTick();
initAudioListeners();
window.api.sendSong(cloneDeep(playerStore.playMusic));
if (isElectron) {
window.api.sendSong(cloneDeep(playerStore.playMusic));
}
}
// 初始化快捷键
initShortcut();