feat: 优化播放逻辑

This commit is contained in:
alger
2026-02-06 20:34:07 +08:00
parent 0e47c127fe
commit b955e95edc
7 changed files with 227 additions and 138 deletions
+6 -3
View File
@@ -563,9 +563,12 @@ export const usePlaylistStore = defineStore(
// 检查URL是否已过期
if (song.expiredAt && song.expiredAt < Date.now()) {
console.info(`歌曲URL已过期,重新获取: ${song.name}`);
song.playMusicUrl = undefined;
song.expiredAt = undefined;
// 本地音乐(local:// 协议)不会过期
if (!song.playMusicUrl?.startsWith('local://')) {
console.info(`歌曲URL已过期,重新获取: ${song.name}`);
song.playMusicUrl = undefined;
song.expiredAt = undefined;
}
}
// 如果是当前正在播放的音乐,则切换播放/暂停状态