From 5ded7f4f9dbfc036a4f77266bb9f4779affd8010 Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Mon, 26 May 2025 10:56:53 +1000 Subject: [PATCH] =?UTF-8?q?refactor(Player):=20=E7=A7=BB=E9=99=A4=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E7=9A=84console.log=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 清理播放器组件中用于调试的console.log输出语句,保持代码整洁 --- src/components/Player.vue | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 3e985f7..e552993 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -12,10 +12,7 @@ const playQueueStore = usePlayQueueStore() const route = useRoute() const player = useTemplateRef('playerRef') -console.log('[Player] 组件初始化') - watch(() => playQueueStore.isPlaying, (newValue) => { - console.log('[Player] 播放状态变化:', newValue) if (newValue) { player.value?.play() setMetadata() @@ -37,7 +34,6 @@ function artistsOrganize(list: string[]) { } function setMetadata() { - console.log('[Player] 设置元数据') if ('mediaSession' in navigator) { navigator.mediaSession.metadata = new MediaMetadata({ title: playQueueStore.list[playQueueStore.currentIndex].song.name, @@ -128,16 +124,13 @@ watch(() => playQueueStore.list.length, async (newLength) => { // 监听音频元素变化 watch(() => player.value, (audioElement) => { - console.log('[Player] 音频元素 ref 变化:', !!audioElement) if (audioElement && playQueueStore.list.length > 0) { - console.log('[Player] 重新连接音频元素') connectAudio(audioElement) } }) // 监听可视化器数据变化 watch(() => barHeights.value, (newHeights) => { - console.log('[Player] 可视化器数据更新:', newHeights.map(h => Math.round(h))) playQueueStore.visualizer = newHeights }, { deep: true })