From 9e4b53b1e766d4781da2671d0401fa8632b4c9cd Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Thu, 29 May 2025 15:55:38 +1000 Subject: [PATCH] fix: change axios request from GET to HEAD for song source URL in PlayListItem.vue --- src/components/PlayListItem.vue | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/PlayListItem.vue b/src/components/PlayListItem.vue index 2e8f5d4..cf2ba42 100644 --- a/src/components/PlayListItem.vue +++ b/src/components/PlayListItem.vue @@ -23,16 +23,13 @@ const emit = defineEmits<{ onMounted(async () => { try { - await axios.get(props.item.song.sourceUrl ?? '', { - headers: { - 'Range': 'bytes=0-0' - } - }) - } catch (error) { } - // 刷新资源地址 - const updatedSong = await apis.getSong(props.item.song.cid) - console.log('Updated song:', updatedSong) - props.item.song.sourceUrl = updatedSong.sourceUrl + await axios.head(props.item.song.sourceUrl ?? '') + } catch (error) { + // 刷新资源地址 + const updatedSong = await apis.getSong(props.item.song.cid) + console.log('Updated song:', updatedSong) + props.item.song.sourceUrl = updatedSong.sourceUrl + } })