mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-23 15:47:23 +08:00
🐞 fix: 修复登录状态问题 修复播放退出登录的问题
This commit is contained in:
@@ -14,15 +14,19 @@ export const getMusicQualityDetail = (id: number) => {
|
||||
|
||||
// 根据音乐Id获取音乐播放URl
|
||||
export const getMusicUrl = async (id: number) => {
|
||||
const res = await request.get('/song/download/url/v1', {
|
||||
params: {
|
||||
id,
|
||||
level: store.state.setData.musicQuality || 'higher'
|
||||
}
|
||||
});
|
||||
// 判断是否登录
|
||||
if (store.state.user) {
|
||||
const res = await request.get('/song/download/url/v1', {
|
||||
params: {
|
||||
id,
|
||||
level: store.state.setData.musicQuality || 'higher',
|
||||
cookie: `${localStorage.getItem('token')} os=pc;`
|
||||
}
|
||||
});
|
||||
|
||||
if (res.data.data.url) {
|
||||
return { data: { data: [{ ...res.data.data }] } };
|
||||
if (res.data.data.url) {
|
||||
return { data: { data: [{ ...res.data.data }] } };
|
||||
}
|
||||
}
|
||||
|
||||
return await request.get('/song/url/v1', {
|
||||
|
||||
Reference in New Issue
Block a user