mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-23 23:57:22 +08:00
🐞 fix: 修复菜单问题
This commit is contained in:
@@ -64,11 +64,19 @@ const loadHotSearchKeyword = async () => {
|
||||
watchEffect(() => {
|
||||
const user = localStorage.getItem('user')
|
||||
store.state.user = user ? JSON.parse(user) : null
|
||||
if(!user){
|
||||
userSetOptions.value = USER_SET_OPTIONS.filter(item => item.key !== 'logout')
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => store.state.user,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
userSetOptions.value = USER_SET_OPTIONS
|
||||
}else{
|
||||
userSetOptions.value = USER_SET_OPTIONS.filter(item => item.key !== 'logout')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const loadPage = async () => {
|
||||
const token = localStorage.getItem("token")
|
||||
if (!token) return
|
||||
|
||||
Reference in New Issue
Block a user