fix: change axios request from GET to HEAD for song source URL in PlayListItem.vue
Some checks failed
Some checks failed
This commit is contained in:
parent
a85a092e5c
commit
9e4b53b1e7
|
@ -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
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user