mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
fix: bugs
This commit is contained in:
parent
79de3009ad
commit
b98d69af18
4 changed files with 42 additions and 24 deletions
|
|
@ -98,6 +98,11 @@ export default {
|
||||||
name: 'playlists',
|
name: 'playlists',
|
||||||
data: result.playlist,
|
data: result.playlist,
|
||||||
});
|
});
|
||||||
|
// 更新用户”喜欢的歌曲“歌单ID
|
||||||
|
commit('updateData', {
|
||||||
|
key: 'likedSongPlaylistID',
|
||||||
|
value: result.playlist[0].id,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -98,14 +98,20 @@ export function dailyTask() {
|
||||||
isAccountLoggedIn() &&
|
isAccountLoggedIn() &&
|
||||||
(lastDate === undefined || lastDate !== dayjs().date())
|
(lastDate === undefined || lastDate !== dayjs().date())
|
||||||
) {
|
) {
|
||||||
console.log('execute dailyTask');
|
console.debug('[debug][common.js] execute dailyTask');
|
||||||
store.commit('updateData', {
|
refreshCookie().then(() => {
|
||||||
key: 'lastRefreshCookieDate',
|
console.debug('[debug][common.js] 刷新cookie');
|
||||||
value: dayjs().date(),
|
store.commit('updateData', {
|
||||||
|
key: 'lastRefreshCookieDate',
|
||||||
|
value: dayjs().date(),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
dailySignin(0).catch(() => {
|
||||||
|
console.debug('[debug][common.js] 手机端重复签到');
|
||||||
|
});
|
||||||
|
dailySignin(1).catch(() => {
|
||||||
|
console.debug('[debug][common.js] PC端重复签到');
|
||||||
});
|
});
|
||||||
refreshCookie();
|
|
||||||
dailySignin(0);
|
|
||||||
dailySignin(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -191,29 +191,34 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
NProgress.start();
|
NProgress.start();
|
||||||
|
this.loadData();
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
if (this.liked.songsWithDetails.length > 0) {
|
this.loadData();
|
||||||
NProgress.done();
|
|
||||||
this.show = true;
|
|
||||||
this.getRandomLyric();
|
|
||||||
} else {
|
|
||||||
this.$store.dispatch('fetchLikedSongsWithDetails').then(() => {
|
|
||||||
NProgress.done();
|
|
||||||
this.show = true;
|
|
||||||
this.getRandomLyric();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.$store.dispatch('fetchLikedSongs');
|
|
||||||
this.$store.dispatch('fetchLikedPlaylist');
|
|
||||||
this.$store.dispatch('fetchLikedAlbums');
|
|
||||||
this.$store.dispatch('fetchLikedArtists');
|
|
||||||
this.$store.dispatch('fetchLikedMVs');
|
|
||||||
dailyTask();
|
dailyTask();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['showToast']),
|
...mapActions(['showToast']),
|
||||||
...mapMutations(['updateModal', 'updateData']),
|
...mapMutations(['updateModal', 'updateData']),
|
||||||
|
loadData() {
|
||||||
|
if (this.liked.songsWithDetails.length > 0) {
|
||||||
|
NProgress.done();
|
||||||
|
this.show = true;
|
||||||
|
this.$store.dispatch('fetchLikedSongsWithDetails');
|
||||||
|
this.getRandomLyric();
|
||||||
|
} else {
|
||||||
|
this.$store.dispatch('fetchLikedSongsWithDetails').then(() => {
|
||||||
|
NProgress.done();
|
||||||
|
this.show = true;
|
||||||
|
this.getRandomLyric();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.$store.dispatch('fetchLikedSongs');
|
||||||
|
this.$store.dispatch('fetchLikedPlaylist');
|
||||||
|
this.$store.dispatch('fetchLikedAlbums');
|
||||||
|
this.$store.dispatch('fetchLikedArtists');
|
||||||
|
this.$store.dispatch('fetchLikedMVs');
|
||||||
|
},
|
||||||
playLikedSongs() {
|
playLikedSongs() {
|
||||||
this.$store.state.player.playPlaylistByID(
|
this.$store.state.player.playPlaylistByID(
|
||||||
this.liked.playlists[0].id,
|
this.liked.playlists[0].id,
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,9 @@ export default {
|
||||||
setCookies(data.cookie);
|
setCookies(data.cookie);
|
||||||
this.updateData({ key: 'user', value: data.profile });
|
this.updateData({ key: 'user', value: data.profile });
|
||||||
this.updateData({ key: 'loginMode', value: 'account' });
|
this.updateData({ key: 'loginMode', value: 'account' });
|
||||||
this.$router.push({ path: '/library' });
|
this.$store.dispatch('fetchLikedPlaylist').then(() => {
|
||||||
|
this.$router.push({ path: '/library' });
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.processing = false;
|
this.processing = false;
|
||||||
nativeAlert(data.msg ?? data.message ?? '账号或密码错误,请检查');
|
nativeAlert(data.msg ?? data.message ?? '账号或密码错误,请检查');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue