@@ -37,6 +37,8 @@ export type AudioSource = {
3737 isTrial ?: boolean ;
3838 /** 音质 */
3939 quality ?: QualityType ;
40+ /** 音源 */
41+ source ?: string ;
4042} ;
4143
4244class SongManager {
@@ -206,13 +208,15 @@ class SongManager {
206208 // 推断音质
207209 let quality = QualityType . HQ ;
208210 if ( unlockUrl && ( unlockUrl . includes ( ".flac" ) || unlockUrl . includes ( ".wav" ) ) ) {
209- quality = QualityType . SQ ;
211+ quality = QualityType . SQ ;
210212 }
213+ console . log ( `最终音质判断:详细输出:` , { unlockUrl, quality } ) ;
211214 return {
212215 id : songId ,
213216 url : unlockUrl ,
214217 isUnlocked : true ,
215218 quality,
219+ source : r . value . server ,
216220 } ;
217221 }
218222 }
@@ -358,20 +362,20 @@ class SongManager {
358362 // 如果官方链接有效且非试听(或者用户接受试听)
359363 if ( officialUrl && ( ! isTrial || ( isTrial && settingStore . playSongDemo ) ) ) {
360364 if ( isTrial ) window . $message . warning ( "当前歌曲仅可试听" ) ;
361- return { id : songId , url : officialUrl , quality, isUnlocked : false } ;
365+ return { id : songId , url : officialUrl , quality, isUnlocked : false , source : "netease" } ;
362366 }
363367 // 尝试解锁
364368 if ( canUnlock ) {
365369 const unlockUrl = await this . getUnlockSongUrl ( song ) ;
366370 if ( unlockUrl . url ) {
367- console . log ( `🔓 [${ songId } ] 解锁成功` ) ;
371+ console . log ( `🔓 [${ songId } ] 解锁成功` , unlockUrl ) ;
368372 return unlockUrl ;
369373 }
370374 }
371375 // 最后的兜底:检查本地是否有缓存(不区分音质)
372376 const fallbackUrl = await this . checkLocalCache ( songId ) ;
373377 if ( fallbackUrl ) {
374- console . log ( `🚀 [${ songId } ] 网络请求失败,使用本地缓存兜底` ) ;
378+ console . log ( `🚀 [${ songId } ] 网络请求失败,使用本地缓存兜底` , fallbackUrl ) ;
375379 return { id : songId , url : fallbackUrl , isUnlocked : true } ;
376380 }
377381 // 无可用源
0 commit comments